aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLulonaut <lulonaut@tutanota.de>2022-12-07 03:50:06 +0100
committerGitHub <noreply@github.com>2022-12-07 13:50:06 +1100
commit66741353bba3bb97b223c41bfc200b9ee04d5c7e (patch)
treefebe213ec0ec4179321d30c54d2387db309fa641
parent200549b4255c50dfaf55fc46e0e08bdfd672435a (diff)
downloadNotEnoughUpdates-66741353bba3bb97b223c41bfc200b9ee04d5c7e.tar.gz
NotEnoughUpdates-66741353bba3bb97b223c41bfc200b9ee04d5c7e.tar.bz2
NotEnoughUpdates-66741353bba3bb97b223c41bfc200b9ee04d5c7e.zip
Fix inventory backpack keybind not working without unrelated option (#468)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java37
1 files changed, 7 insertions, 30 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java
index 572b0fbf..205dcd83 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java
@@ -79,33 +79,8 @@ public class InventoryStorageSelector {
!NotEnoughUpdates.INSTANCE.config.storageGUI.showInvBackpack) {
return;
}
- if (Minecraft.getMinecraft().currentScreen != null) {
- return;
- }
-
- if (NotEnoughUpdates.INSTANCE.config.storageGUI.arrowKeyBackpacks) {
- if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) {
- NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--;
-
- int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1;
- if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max)
- NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max;
- if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0)
- NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0;
- } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) {
- NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++;
- int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1;
- if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max)
- NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max;
- if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0)
- NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0;
- } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) {
- sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex);
- }
- }
-
- if (isSlotSelected()) {
+ if (Minecraft.getMinecraft().currentScreen == null && isSlotSelected()) {
int useKeycode = Minecraft.getMinecraft().gameSettings.keyBindUseItem.getKeyCode() + 100;
int attackKeycode = Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode() + 100;
@@ -147,11 +122,13 @@ public class InventoryStorageSelector {
return;
}
+ if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackHotkey)) {
+ Minecraft.getMinecraft().thePlayer.inventory.currentItem = 0;
+ isOverridingSlot = true;
+ }
+
if (NotEnoughUpdates.INSTANCE.config.storageGUI.arrowKeyBackpacks) {
- if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackHotkey)) {
- Minecraft.getMinecraft().thePlayer.inventory.currentItem = 0;
- isOverridingSlot = true;
- } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) {
+ if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) {
NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--;
int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1;