diff --git a/gradle.properties b/gradle.properties index 3c6b1794..ca769d37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false minecraft_version=1.19.2 forge_version=43.2.13 -mod_version=3.19.3 +mod_version=3.19.4 jei_mc_version=1.19.2-forge jei_version=11.6.0.+ curios_version=1.19.2-5.1.1.+ diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java index 2f40fa6d..7e52ad36 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/KeybindHandler.java @@ -199,16 +199,9 @@ private static boolean sendBackpackOpenOrCloseMessage() { return true; } } - if (screen instanceof BackpackScreen) { - if (slot != null && slot.getItem().getItem() instanceof BackpackItem) { - if (slot.getItem().getCount() == 1) { - SBPPacketHandler.INSTANCE.sendToServer(new BackpackOpenMessage(slot.index)); - return true; - } - } else { - SBPPacketHandler.INSTANCE.sendToServer(new BackpackCloseMessage()); - return true; - } + if (screen instanceof BackpackScreen && slot != null && slot.getItem().getItem() instanceof BackpackItem && slot.getItem().getCount() == 1) { + SBPPacketHandler.INSTANCE.sendToServer(new BackpackOpenMessage(slot.index)); + return true; } } return false; diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/gui/BackpackScreen.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/gui/BackpackScreen.java index fd371718..ccb9166a 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/gui/BackpackScreen.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/client/gui/BackpackScreen.java @@ -24,9 +24,13 @@ public BackpackScreen(BackpackContainer screenContainer, Inventory inv, Componen @Override public boolean keyPressed(int keyCode, int scanCode, int modifiers) { if (keyCode == 256 || KeybindHandler.BACKPACK_OPEN_KEYBIND.isActiveAndMatches(InputConstants.getKey(keyCode, scanCode))) { - if (getMenu().isFirstLevelStorage() && getMenu().getBackpackContext().wasOpenFromInventory() && (keyCode == 256 || mouseNotOverBackpack())) { - getMinecraft().player.closeContainer(); - getMinecraft().setScreen(new InventoryScreen(getMinecraft().player)); + if (getMenu().isFirstLevelStorage() && (keyCode == 256 || mouseNotOverBackpack())) { + if (getMenu().getBackpackContext().wasOpenFromInventory()) { + getMinecraft().player.closeContainer(); + getMinecraft().setScreen(new InventoryScreen(getMinecraft().player)); + } else { + onClose(); + } return true; } else if (!getMenu().isFirstLevelStorage()) { SBPPacketHandler.INSTANCE.sendToServer(new BackpackOpenMessage());