-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lag when trying to right click items but the interaction fails (#463
) (cherry picked from commit 96b1f83)
- Loading branch information
1 parent
9f0e08c
commit 64a48cc
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinInventoryCrafting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.mitchej123.hodgepodge.mixins.early.minecraft; | ||
|
||
import net.minecraft.inventory.InventoryCrafting; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(InventoryCrafting.class) | ||
public class MixinInventoryCrafting { | ||
|
||
@Shadow | ||
private ItemStack[] stackList; | ||
|
||
@Inject(method = "setInventorySlotContents", at = @At("HEAD"), cancellable = true) | ||
public void setInventorySlotContents(int index, ItemStack stack, CallbackInfo ci) { | ||
if (stack == null && this.stackList[index] == null) ci.cancel(); | ||
} | ||
|
||
} |