From 978c058d05aa25da9c5e5c0ab8a85a63ed3b1c58 Mon Sep 17 00:00:00 2001 From: Kal Draganov Date: Thu, 10 Dec 2020 13:50:54 -0500 Subject: Additional Features to Experiment Solvers Displays the next item in the sequence for ultrasequencer and chronomatron in blue. Also adds the feature to disable tooltips in the addons (chronomatron and ultrasequencer) --- src/main/java/me/Danker/utils/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/utils/Utils.java') diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index fbd8e4c..0f0a70b 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -280,7 +280,7 @@ public class Utils { GlStateManager.disableAlpha(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GL11.glLineWidth(2); - GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue()/ 255f, colour.getAlpha() / 255f); + GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); worldRenderer.pos(pos1.xCoord, pos1.yCoord, pos1.zCoord).endVertex(); -- cgit From cc01445451740f9f1774d66ef7bf3ad93316f8f2 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 11 Dec 2020 14:05:23 -0500 Subject: Fix issues with select all color terminal --- src/main/java/me/Danker/DankersSkyblockMod.java | 20 +++++++++++++++----- src/main/java/me/Danker/utils/Utils.java | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'src/main/java/me/Danker/utils/Utils.java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 3fe283c..8781645 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -67,6 +67,7 @@ import java.awt.*; import java.text.NumberFormat; import java.util.List; import java.util.*; +import java.util.regex.Matcher; import java.util.regex.Pattern; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) @@ -78,7 +79,8 @@ public class DankersSkyblockMod static double checkItemsNow = 0; static double itemsChecked = 0; public static Map t6Enchants = new HashMap<>(); - public static Pattern pattern = Pattern.compile(""); + public static Pattern t6EnchantPattern = Pattern.compile(""); + static Pattern petPattern = Pattern.compile("\\[Lvl [\\d]{1,3}]"); static boolean updateChecked = false; public static int titleTimer = -1; public static boolean showTitle = false; @@ -115,6 +117,7 @@ public class DankersSkyblockMod static boolean inWaterRoom = false; static String waterAnswers = null; static AxisAlignedBB correctTicTacToeButton = null; + static Pattern startsWithTerminalPattern = Pattern.compile("[A-Z]{2,}"); static Slot[] clickInOrderSlots = new Slot[36]; static int lastChronomatronRound = 0; static List chronomatronPattern = new ArrayList<>(); @@ -257,7 +260,7 @@ public class DankersSkyblockMod "Booger Dragon", "Older Dragon", "Elder Dragon", "Stable Dragon", "Professor Dragon"}); String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; - pattern = Pattern.compile(patternString); + t6EnchantPattern = Pattern.compile(patternString); keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Start/Stop Skill Tracker", Keyboard.KEY_NUMPAD5, "Danker's Skyblock Mod"); @@ -3092,7 +3095,6 @@ public class DankersSkyblockMod int chestSize = inventory.inventorySlots.inventorySlots.size(); if (ToggleCommand.petColoursToggled) { - Pattern petPattern = Pattern.compile("\\[Lvl [\\d]{1,3}]"); for (Slot slot : invSlots) { ItemStack item = slot.getStack(); if (item == null) continue; @@ -3141,11 +3143,19 @@ public class DankersSkyblockMod } if (ToggleCommand.selectAllToggled && Utils.inDungeons && displayName.startsWith("Select all the")) { - String colour = displayName.split(" ")[3]; + String colour; + List colourParts = new ArrayList<>(); + Matcher colourMatcher = startsWithTerminalPattern.matcher(displayName); + while (colourMatcher.find()) { + colourParts.add(colourMatcher.group()); + } + colour = String.join(" ", colourParts); + for (Slot slot : invSlots) { ItemStack item = slot.getStack(); if (item == null) continue; - if (item.getDisplayName().toUpperCase().contains(colour)) { + String itemName = StringUtils.stripControlCodes(item.getDisplayName()).toUpperCase(); + if (itemName.contains(colour) || (colour.equals("SILVER") && itemName.contains("LIGHT GRAY")) || (colour.equals("WHITE") && itemName.equals("WOOL"))) { Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); } } diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index fbd8e4c..7f474c9 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -64,7 +64,7 @@ public class Utils { } public static String returnGoldenEnchants(String line) { - Matcher matcher = DankersSkyblockMod.pattern.matcher(line); + Matcher matcher = DankersSkyblockMod.t6EnchantPattern.matcher(line); StringBuffer out = new StringBuffer(); while (matcher.find()) { -- cgit