diff options
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 58 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/DankerGuiCommand.java | 75 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/EditLocationsGui.java | 2 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 22 | ||||
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 2 |
6 files changed, 140 insertions, 21 deletions
diff --git a/build.gradle b/build.gradle index 0258259..02b9d3c 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.4" +version = "1.8.5-beta1" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b3622bb..e92c0e5 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; import java.util.regex.Matcher; @@ -74,12 +75,13 @@ import java.util.regex.Matcher; public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.4"; + public static final String VERSION = "1.8.5-beta1"; static double checkItemsNow = 0; static double itemsChecked = 0; public static Map<String, String> 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; @@ -116,6 +118,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<String> chronomatronPattern = new ArrayList<>(); @@ -167,6 +170,17 @@ public class DankersSkyblockMod public static String TRIVIA_WRONG_ANSWER_COLOUR; public static int LOWEST_BLAZE_COLOUR; public static int HIGHEST_BLAZE_COLOUR; + public static int PET_1_TO_9; + public static int PET_10_TO_19; + public static int PET_20_TO_29; + public static int PET_30_TO_39; + public static int PET_40_TO_49; + public static int PET_50_TO_59; + public static int PET_60_TO_69; + public static int PET_70_TO_79; + public static int PET_80_TO_89; + public static int PET_90_TO_99; + public static int PET_100; @EventHandler public void init(FMLInitializationEvent event) { @@ -247,7 +261,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"); @@ -3090,7 +3104,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; @@ -3100,29 +3113,29 @@ public class DankersSkyblockMod int colour; int petLevel = Integer.parseInt(item.getDisplayName().substring(item.getDisplayName().indexOf(" ") + 1, item.getDisplayName().indexOf("]"))); if (petLevel == 100) { - colour = 0xBFF2D249; // Gold + colour = PET_100; } else if (petLevel >= 90) { - colour = 0xBF9E794E; // Brown + colour = PET_90_TO_99; } else if (petLevel >= 80) { - colour = 0xBF5C1F35; // idk weird magenta + colour = PET_80_TO_89; } else if (petLevel >= 70) { - colour = 0xBFD64FC8; // Pink + colour = PET_70_TO_79; } else if (petLevel >= 60) { - colour = 0xBF7E4FC6; // Purple + colour = PET_60_TO_69; } else if (petLevel >= 50) { - colour = 0xBF008AD8; // Light Blue + colour = PET_50_TO_59; } else if (petLevel >= 40) { - colour = 0xBF0EAC35; // Green + colour = PET_40_TO_49; } else if (petLevel >= 30) { - colour = 0xBFFFC400; // Yellow + colour = PET_30_TO_39; } else if (petLevel >= 20) { - colour = 0xBFEF5230; // Orange + colour = PET_20_TO_29; } else if (petLevel >= 10) { - colour = 0xBFD62440; // Red + colour = PET_10_TO_19; } else { - colour = 0xBF999999; // Gray + colour = PET_1_TO_9; } - Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, colour); + Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, colour + 0xBF000000); } } } @@ -3139,10 +3152,19 @@ public class DankersSkyblockMod } if (ToggleCommand.selectAllToggled && Utils.inDungeons && displayName.startsWith("Select all the")) { - for (Slot slot : invSlots) { + String colour; + List<String> 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/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 18230e6..cde5b31 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -1,9 +1,15 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.ResourcePackRepository; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + +import java.awt.*; +import java.awt.datatransfer.StringSelection; public class DankerGuiCommand extends CommandBase { @@ -24,6 +30,75 @@ public class DankerGuiCommand extends CommandBase { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + if (arg1.length > 0 && arg1[0].equalsIgnoreCase("debug")) { + StringBuilder debug = new StringBuilder(); + debug.append("```md\n"); + debug.append("# Toggles\n"); + debug.append("[gparty][").append(ToggleCommand.gpartyToggled).append("]\n"); + debug.append("[coords][").append(ToggleCommand.coordsToggled).append("]\n"); + debug.append("[golden][").append(ToggleCommand.goldenToggled).append("]\n"); + debug.append("[slayercount][").append(ToggleCommand.slayerCountTotal).append("]\n"); + debug.append("[rngesusalerts][").append(ToggleCommand.rngesusAlerts).append("]\n"); + debug.append("[splitfishing][").append(ToggleCommand.splitFishing).append("]\n"); + debug.append("[chatmaddox][").append(ToggleCommand.chatMaddoxToggled).append("]\n"); + debug.append("[spiritbearalerts][").append(ToggleCommand.spiritBearAlerts).append("]\n"); + debug.append("[aotd][").append(ToggleCommand.aotdToggled).append("]\n"); + debug.append("[lividdagger][").append(ToggleCommand.lividDaggerToggled).append("]\n"); + debug.append("[sceptremessages][").append(ToggleCommand.sceptreMessages).append("]\n"); + debug.append("[petcolors][").append(ToggleCommand.petColoursToggled).append("]\n"); + debug.append("[dungeontimer][").append(ToggleCommand.dungeonTimerToggled).append("]\n"); + debug.append("[golemalerts][").append(ToggleCommand.golemAlertToggled).append("]\n"); + debug.append("[expertiselore][").append(ToggleCommand.expertiseLoreToggled).append("]\n"); + debug.append("[skill50display][").append(ToggleCommand.skill50DisplayToggled).append("]\n"); + debug.append("[outlinetext][").append(ToggleCommand.outlineTextToggled).append("]\n"); + debug.append("[midasstaffmessages][").append(ToggleCommand.midasStaffMessages).append("]\n"); + debug.append("[implosionmessages][").append(ToggleCommand.implosionMessages).append("]\n"); + debug.append("[healmessages][").append(ToggleCommand.healMessages).append("]\n"); + debug.append("[caketimer][").append(ToggleCommand.cakeTimerToggled).append("]\n"); + debug.append("[lowhealthnotify][").append(ToggleCommand.lowHealthNotifyToggled).append("]\n"); + debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n"); + debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n"); + debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); + debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); + debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); + debug.append("[creeperpuzzle][").append(ToggleCommand.creeperToggled).append("]\n"); + debug.append("[waterpuzzle][").append(ToggleCommand.waterToggled).append("]\n"); + debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); + debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); + debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); + debug.append("[itemframeonsealanterns][").append(ToggleCommand.itemFrameOnSeaLanternsToggled).append("]\n"); + debug.append("[ultrasequencer][").append(ToggleCommand.ultrasequencerToggled).append("]\n"); + debug.append("[chronomatron][").append(ToggleCommand.chronomatronToggled).append("]\n"); + debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); + debug.append("[pickblockinexperiments][").append(ToggleCommand.swapToPickBlockInExperimentsToggled).append("]\n"); + debug.append("# Locations\n"); + debug.append("[coords][").append(MoveCommand.coordsXY[0]).append(", ").append(MoveCommand.coordsXY[1]).append("]\n"); + debug.append("[display][").append(MoveCommand.displayXY[0]).append(", ").append(MoveCommand.displayXY[1]).append("]\n"); + debug.append("[dungeontimer][").append(MoveCommand.dungeonTimerXY[0]).append(", ").append(MoveCommand.dungeonTimerXY[1]).append("]\n"); + debug.append("[skill50][").append(MoveCommand.skill50XY[0]).append(", ").append(MoveCommand.skill50XY[1]).append("]\n"); + debug.append("[lividhp][").append(MoveCommand.lividHpXY[0]).append(", ").append(MoveCommand.lividHpXY[1]).append("]\n"); + debug.append("[caketimer][").append(MoveCommand.cakeTimerXY[0]).append(", ").append(MoveCommand.cakeTimerXY[1]).append("]\n"); + debug.append("[skilltracker][").append(MoveCommand.skillTrackerXY[0]).append(", ").append(MoveCommand.skillTrackerXY[1]).append("]\n"); + debug.append("[wateranswer][").append(MoveCommand.waterAnswerXY[0]).append(", ").append(MoveCommand.waterAnswerXY[1]).append("]\n"); + debug.append("# Other Settings\n"); + debug.append("[Current Display][").append(DisplayCommand.display).append("]\n"); + debug.append("[Auto Display][").append(DisplayCommand.auto).append("]\n"); + debug.append("[Skill Tracker Visible][").append(DankersSkyblockMod.showSkillTracker).append("]\n"); + debug.append("# Resource Packs\n"); + if (Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries().size() == 0) { + debug.append("<None>\n"); + } else { + for (ResourcePackRepository.Entry resource : Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries()) { + debug.append("< ").append(resource.getResourcePackName()).append(" >\n"); + } + } + debug.append("```"); + StringSelection clipboard = new StringSelection(debug.toString()); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboard, clipboard); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Debug stats copied to clipboard.")); + return; + } + DankersSkyblockMod.guiToOpen = "dankergui1"; } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index 8519f1a..b610ae0 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -221,7 +221,7 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "cakeTimerY", MoveCommand.cakeTimerXY[1]); ConfigHandler.writeIntConfig("locations", "skillTrackerX", MoveCommand.skillTrackerXY[0]); ConfigHandler.writeIntConfig("locations", "skillTrackerY", MoveCommand.skillTrackerXY[1]); - ConfigHandler.writeIntConfig("locations", "waterAnswerX", MoveCommand.waterAnswerXY[1]); + ConfigHandler.writeIntConfig("locations", "waterAnswerX", MoveCommand.waterAnswerXY[0]); ConfigHandler.writeIntConfig("locations", "waterAnswerY", MoveCommand.waterAnswerXY[1]); } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index e8322ea..a0e446f 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -420,6 +420,17 @@ public class ConfigHandler { if (!hasKey("colors", "triviaWrongAnswer")) writeStringConfig("colors", "triviaWrongAnswer", EnumChatFormatting.RED.toString()); if (!hasKey("colors", "blazeLowest")) writeIntConfig("colors", "blazeLowest", 0xFF0000); if (!hasKey("colors", "blazeHighest")) writeIntConfig("colors", "blazeHighest", 0x40FF40); + if (!hasKey("colors", "pet1To9")) writeIntConfig("colors", "pet1To9", 0x999999); // Gray + if (!hasKey("colors", "pet10To19")) writeIntConfig("colors", "pet10To19", 0xD62440); // Red + if (!hasKey("colors", "pet20To29")) writeIntConfig("colors", "pet20To29", 0xEF5230); // Orange + if (!hasKey("colors", "pet30To39")) writeIntConfig("colors", "pet30To39", 0xFFC400); // Yellow + if (!hasKey("colors", "pet40To49")) writeIntConfig("colors", "pet40To49", 0x0EAC35); // Green + if (!hasKey("colors", "pet50To59")) writeIntConfig("colors", "pet50To59", 0x008AD8); // Light Blue + if (!hasKey("colors", "pet60To69")) writeIntConfig("colors", "pet60To69", 0x7E4FC6); // Purple + if (!hasKey("colors", "pet70To79")) writeIntConfig("colors", "pet70To79", 0xD64FC8); // Pink + if (!hasKey("colors", "pet80To89")) writeIntConfig("colors", "pet80To89", 0x5C1F35); // idk weird magenta + if (!hasKey("colors", "pet90To99")) writeIntConfig("colors", "pet90To99", 0x9E794E); // Brown + if (!hasKey("colors", "pet100")) writeIntConfig("colors", "pet100", 0xF2D249); // Gold ToggleCommand.gpartyToggled = getBoolean("toggles", "GParty"); ToggleCommand.coordsToggled = getBoolean("toggles", "Coords"); @@ -676,6 +687,17 @@ public class ConfigHandler { DankersSkyblockMod.TRIVIA_WRONG_ANSWER_COLOUR = getString("colors", "triviaWrongAnswer"); DankersSkyblockMod.LOWEST_BLAZE_COLOUR = getInt("colors", "blazeLowest"); DankersSkyblockMod.HIGHEST_BLAZE_COLOUR = getInt("colors", "blazeHighest"); + DankersSkyblockMod.PET_1_TO_9 = getInt("colors", "pet1To9"); + DankersSkyblockMod.PET_10_TO_19 = getInt("colors", "pet10To19"); + DankersSkyblockMod.PET_20_TO_29 = getInt("colors", "pet20To29"); + DankersSkyblockMod.PET_30_TO_39 = getInt("colors", "pet30To39"); + DankersSkyblockMod.PET_40_TO_49 = getInt("colors", "pet40To49"); + DankersSkyblockMod.PET_50_TO_59 = getInt("colors", "pet50To59"); + DankersSkyblockMod.PET_60_TO_69 = getInt("colors", "pet60To69"); + DankersSkyblockMod.PET_70_TO_79 = getInt("colors", "pet70To79"); + DankersSkyblockMod.PET_80_TO_89 = getInt("colors", "pet80To89"); + DankersSkyblockMod.PET_90_TO_99 = getInt("colors", "pet90To99"); + DankersSkyblockMod.PET_100 = getInt("colors", "pet100"); } } diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 0f0a70b..e4f7873 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()) { |