diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-12-06 02:48:29 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-12-06 02:48:29 -0500 |
commit | 4d14eedaddef70a0eb9b9f99a85dddc65d681c94 (patch) | |
tree | a78bb29475e855174dfa318eecee9f6463ada158 | |
parent | c82c3955c092437c7e89df4791053a6e8a889c89 (diff) | |
download | SkyblockMod-4d14eedaddef70a0eb9b9f99a85dddc65d681c94.tar.gz SkyblockMod-4d14eedaddef70a0eb9b9f99a85dddc65d681c94.tar.bz2 SkyblockMod-4d14eedaddef70a0eb9b9f99a85dddc65d681c94.zip |
Change override from shift to control
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 01cd407..e0562cf 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -114,6 +114,7 @@ public class DankersSkyblockMod static boolean inWaterRoom = false; static AxisAlignedBB correctTicTacToeButton = null; static List<Slot> clickInOrderSlots = new ArrayList<>(); + static Slot[] clickInOrderSlotsTEMP = new Slot[36]; static int lastChronomatronRound = 0; static List<String> chronomatronPattern = new ArrayList<>(); static int chronomatronMouseClicks = 0; @@ -2247,22 +2248,22 @@ public class DankersSkyblockMod } } - if(mc.currentScreen instanceof GuiChest) { + if (mc.currentScreen instanceof GuiChest) { ContainerChest chest = (ContainerChest) player.openContainer; IInventory inv = chest.getLowerChestInventory(); String chestName = inv.getDisplayName().getUnformattedText(); if (ToggleCommand.superpairsToggled && chestName.contains("Superpairs (")) { - if(Item.getIdFromItem(item.getItem()) != 95) return; - if(item.getDisplayName().contains("Click any button") || item.getDisplayName().contains("Click a second button") || item.getDisplayName().contains("Next button is instantly rewarded") || item.getDisplayName().contains("Stained Glass")) { + if (Item.getIdFromItem(item.getItem()) != 95) return; + if (item.getDisplayName().contains("Click any button") || item.getDisplayName().contains("Click a second button") || item.getDisplayName().contains("Next button is instantly rewarded") || item.getDisplayName().contains("Stained Glass")) { Slot slot = ((GuiChest) mc.currentScreen).getSlotUnderMouse(); ItemStack itemStack = experimentTableSlots[slot.getSlotIndex()]; - if(itemStack == null) return; + if (itemStack == null) return; String itemName = itemStack.getDisplayName(); - if(event.toolTip.stream().anyMatch(x->StringUtils.stripControlCodes(x).equals(StringUtils.stripControlCodes(itemName)))) return; - event.toolTip.removeIf(x->{ + if (event.toolTip.stream().anyMatch(x->StringUtils.stripControlCodes(x).equals(StringUtils.stripControlCodes(itemName)))) return; + event.toolTip.removeIf(x -> { x = StringUtils.stripControlCodes(x); - if(x.equals("minecraft:stained_glass")) return true; + if (x.equals("minecraft:stained_glass")) return true; return x.startsWith("NBT: "); }); event.toolTip.add(itemName); @@ -2651,8 +2652,8 @@ public class DankersSkyblockMod } } - if(mc.currentScreen instanceof GuiChest) { - if(player == null) return; + if (mc.currentScreen instanceof GuiChest) { + if (player == null) return; ContainerChest chest = (ContainerChest) player.openContainer; IInventory inv = chest.getLowerChestInventory(); String chestName = inv.getDisplayName().getUnformattedText(); @@ -2663,10 +2664,10 @@ public class DankersSkyblockMod String itemName = itemStack.getDisplayName(); if (Item.getIdFromItem(itemStack.getItem()) == 95 || Item.getIdFromItem(itemStack.getItem()) == 160) continue; if (itemName.contains("Instant Find") || itemName.contains("Gained +")) continue; - if(itemName.contains("Enchanted Book")) { + if (itemName.contains("Enchanted Book")) { itemName = itemStack.getTooltip(mc.thePlayer, false).get(3); } - if(itemStack.stackSize > 1) { + if (itemStack.stackSize > 1) { itemName = itemStack.stackSize + " " + itemName; } if (experimentTableSlots[i] != null) continue; @@ -2880,25 +2881,25 @@ public class DankersSkyblockMod } if (ToggleCommand.chronomatronToggled && inventoryName.startsWith("Chronomatron (")) { - if(item == null) { - if(event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) event.setCanceled(true); + if (item == null) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) event.setCanceled(true); return; } if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) { - if(chronomatronPattern.size() > 0 && chronomatronPattern.size() > chronomatronMouseClicks && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - if(event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) event.setCanceled(true); + if (chronomatronPattern.size() > chronomatronMouseClicks && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) event.setCanceled(true); return; } chronomatronMouseClicks++; - } else if(inventory.getStackInSlot(49).getDisplayName().startsWith("§aRemember the pattern!")) { - if(event.isCancelable()) event.setCanceled(true); + } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§aRemember the pattern!")) { + if (event.isCancelable()) event.setCanceled(true); return; } } if (ToggleCommand.ultrasequencerToggled && inventoryName.startsWith("Ultrasequencer (")) { if (item == null) { - if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) event.setCanceled(true); return; } @@ -2907,7 +2908,7 @@ public class DankersSkyblockMod return; } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a")) { if (lastUltraSequencerClicked < clickInOrderSlots.size() && mouseSlot.getSlotIndex() != clickInOrderSlots.get(lastUltraSequencerClicked).getSlotIndex()) { - if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) event.setCanceled(true); return; } @@ -3112,11 +3113,11 @@ public class DankersSkyblockMod new TextRenderer(mc, String.join("\n", chronomatronPattern), (int) (guiLeft * 0.8), 10, 1); } - if(ToggleCommand.superpairsToggled && displayName.contains("Superpairs (")) { + if (ToggleCommand.superpairsToggled && displayName.contains("Superpairs (")) { HashMap<String, HashSet<Integer>> matches = new HashMap<>(); for(int i = 0; i<53; i++) { ItemStack itemStack = experimentTableSlots[i]; - if(itemStack == null) continue; + if (itemStack == null) continue; Slot slot = invSlots.get(i); int x = guiLeft + slot.xDisplayPosition; int y = guiTop + slot.yDisplayPosition; @@ -3150,7 +3151,7 @@ public class DankersSkyblockMod Iterator<Color> colorIterator = Arrays.stream(colors).iterator(); matches.forEach((itemName, slotSet)->{ - if(slotSet.size() < 2) return; + if (slotSet.size() < 2) return; ArrayList<Slot> slots = new ArrayList<>(); slotSet.forEach(slotNum->slots.add(invSlots.get(slotNum))); Color color = colorIterator.next(); |