aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java
index 3ed16e76..82634c87 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java
@@ -30,6 +30,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -166,6 +167,12 @@ public abstract class MixinGuiContainer extends GuiScreen {
}
return slot.canBeHovered();
}
+ @Inject(method="checkHotbarKeys", at=@At(value = "INVOKE", target = "Lnet/minecraft/client/gui/inventory/GuiContainer;handleMouseClick(Lnet/minecraft/inventory/Slot;III)V"), locals = LocalCapture.CAPTURE_FAILSOFT ,cancellable = true)
+ public void checkHotbarKeys_Slotlock(int keyCode, CallbackInfoReturnable<Boolean> cir, int i){
+ if(SlotLocking.getInstance().isSlotIndexLocked(i)){
+ cir.setReturnValue(false);
+ }
+ }
@Inject(method="handleMouseClick", at=@At(value="HEAD"), cancellable = true)
public void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType, CallbackInfo ci) {
@@ -209,5 +216,4 @@ public abstract class MixinGuiContainer extends GuiScreen {
}
}
}
-
}