diff options
| author | DoKM <mcazzyman@gmail.com> | 2021-08-09 22:43:33 +0200 |
|---|---|---|
| committer | DoKM <mcazzyman@gmail.com> | 2021-08-09 22:43:33 +0200 |
| commit | 8f010423e71ff5017104762511ef08f67eb5a87a (patch) | |
| tree | b926e52df8095a453e5f6960b6ba2d354e272906 /src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java | |
| parent | 9b3b7163d0e2643e4dce82299315ec8bde8a0420 (diff) | |
| download | notenoughupdates-8f010423e71ff5017104762511ef08f67eb5a87a.tar.gz notenoughupdates-8f010423e71ff5017104762511ef08f67eb5a87a.tar.bz2 notenoughupdates-8f010423e71ff5017104762511ef08f67eb5a87a.zip | |
Fixed not being able to use keybinds while hovering over locked slots
Took way longer than it could have cause i couldnt find out why something was null smh
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index a4af51ca..5ca9b316 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -8,6 +8,7 @@ import com.mojang.authlib.Agent; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.util.TexLoc; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -433,7 +434,11 @@ public class Utils { } public static Slot getSlotUnderMouse(GuiContainer container) { - return (Slot) getField(GuiContainer.class, container, "theSlot", "field_147006_u"); + Slot slot = (Slot) getField(GuiContainer.class, container, "theSlot", "field_147006_u"); + if(slot == null){ + slot = SlotLocking.getInstance().getRealSlot(); + } + return slot; } public static void drawTexturedRect(float x, float y, float width, float height) { |
