aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoKM <mcazzyman@gmail.com>2021-08-21 11:44:30 +0200
committerDoKM <mcazzyman@gmail.com>2021-08-21 11:44:30 +0200
commitfefed35f9af4e2abdedf9d1788d83662171089c8 (patch)
treebd867feef3f7ca5e39aa9dd12b4bd8abc32cd7d6
parent9bdf107725ec331d0acb24a53ad3708547bfdb06 (diff)
downloadNotEnoughUpdates-fefed35f9af4e2abdedf9d1788d83662171089c8.tar.gz
NotEnoughUpdates-fefed35f9af4e2abdedf9d1788d83662171089c8.tar.bz2
NotEnoughUpdates-fefed35f9af4e2abdedf9d1788d83662171089c8.zip
Fix being able to hotkey slotlocked items in a container
-rw-r--r--Update Notes/2.0-Pre31.md7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java8
2 files changed, 11 insertions, 4 deletions
diff --git a/Update Notes/2.0-Pre31.md b/Update Notes/2.0-Pre31.md
index 6f8fe8a4..bd0360f3 100644
--- a/Update Notes/2.0-Pre31.md
+++ b/Update Notes/2.0-Pre31.md
@@ -29,6 +29,7 @@
- Added a crafting recipe overlay when looking up a recipe while in the crafting menu (to more easily craft items like the Soul Esoward recipe) (DeDiamondPro)
- Added mastermode support to /pv (basically done, just needs mastermode xp)
- Added ability to toggle the pickaxe's ability cooldown showing up as the pickaxe durability.
+- Added alternative command for "/neusouls" "/fairysouls".
### **Bug Fixes**
@@ -55,9 +56,9 @@
- Fixed dwarven mines waypoints not working if dwarven mines overlay was disabled.
- Fixed being able to slot lock the 9th slot.
- Fixed NEUButtons overlapping with the Accessory Bag overlay by moving the overlapping icons to the right of the overlay. (should work pretty well, too lazy to test with custom button positions but should work fine.)
-- Stopped tooltip tweak rawcraftcost displaying if the cost was 0 (either due to the price being really low or api issue)
-- Added a catch to the capemanger slow to catch duplicate players (https://hst.sh/enuvamecef) (idk how but hey its there now)
-- Added alternative command for "/neusouls" "/fairysouls"
+- Stopped tooltip tweak rawcraftcost displaying if the cost was 0 (either due to the price being really low or api issue).
+- Added a catch to the capemanger slow to catch duplicate players (https://hst.sh/enuvamecef) (idk how but hey its there now).
+- Fix being able to hotkey slotlocked items in a chest gui.
### **Other**
- Code clean up by Ironm00n.
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 {
}
}
}
-
}