diff options
author | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-05 10:58:21 -0500 |
---|---|---|
committer | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-05 10:58:21 -0500 |
commit | d056aa0ec706820a94e36e2c4866c15a12b9af6e (patch) | |
tree | 803821968ebff6c7f934c72262a1af3c4782974b /src/main/java/me/Danker/DankersSkyblockMod.java | |
parent | b294ee1f83d85bc58bc9b9f97f94135d395ebf74 (diff) | |
download | SkyblockMod-d056aa0ec706820a94e36e2c4866c15a12b9af6e.tar.gz SkyblockMod-d056aa0ec706820a94e36e2c4866c15a12b9af6e.tar.bz2 SkyblockMod-d056aa0ec706820a94e36e2c4866c15a12b9af6e.zip |
Add Superpairs helper
Diffstat (limited to 'src/main/java/me/Danker/DankersSkyblockMod.java')
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 35a19c9..d272121 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -117,8 +117,9 @@ public class DankersSkyblockMod static int lastChronomatronRound = 0; static List<String> chronomatronPattern = new ArrayList<>(); static int chronomatronMouseClicks = 0; - - static double dungeonStartTime = 0; + static ItemStack[] superpairSlots = new ItemStack[53]; + + static double dungeonStartTime = 0; static double bloodOpenTime = 0; static double watcherClearTime = 0; static double bossClearTime = 0; @@ -2605,6 +2606,28 @@ public class DankersSkyblockMod } } } + if(mc.currentScreen instanceof GuiChest) { + ContainerChest chest = (ContainerChest) mc.thePlayer.openContainer; + IInventory inv = chest.getLowerChestInventory(); + String chestName = inv.getDisplayName().getUnformattedText(); + if (ToggleCommand.superpairsToggled && chestName.contains("Superpairs (")) { + for (int i = 0; i < 53; i++) { + ItemStack itemStack = inv.getStackInSlot(i); + if (itemStack == null) continue; + String itemName = itemStack.getDisplayName(); + if (Item.getIdFromItem(itemStack.getItem()) == 95) continue; + if (itemName.contains("Instant Find")) continue; + + if (superpairSlots[i] != null) return; + superpairSlots[i] = itemStack; + } + for (int i = 0; i < 53; i++) { + ItemStack itemStack = superpairSlots[i]; + if (itemStack == null) continue; + inv.setInventorySlotContents(i, itemStack); + } + } + } } // Checks 10 times per second @@ -2619,8 +2642,8 @@ public class DankersSkyblockMod } } } - - if (titleTimer >= 0) { + + if (titleTimer >= 0) { if (titleTimer == 0) { showTitle = false; } @@ -2861,6 +2884,7 @@ public class DankersSkyblockMod lastChronomatronRound = 0; chronomatronPattern.clear(); chronomatronMouseClicks = 0; + superpairSlots = new ItemStack[53]; } @SubscribeEvent |