diff options
| author | bowser0000 <bowser0000@gmail.com> | 2020-11-09 14:50:39 -0500 |
|---|---|---|
| committer | bowser0000 <bowser0000@gmail.com> | 2020-11-09 14:50:39 -0500 |
| commit | 511b95de7dcb83e047dce2adadeff8c18804c1b6 (patch) | |
| tree | 9e83ee2e91842b6c19a5bb05c0a9d7acac89e3ae | |
| parent | 432ee590f73a08b184f0d0ec65b8549aa2f3e877 (diff) | |
| download | SkyblockMod-511b95de7dcb83e047dce2adadeff8c18804c1b6.tar.gz SkyblockMod-511b95de7dcb83e047dce2adadeff8c18804c1b6.tar.bz2 SkyblockMod-511b95de7dcb83e047dce2adadeff8c18804c1b6.zip | |
Add config values for colours and many bug fixes
Fix spooky fishing config values
Add spooky fishing to /importfishing
Add boolean to config to truely turn off chat Maddox
Remove bold red name from three man puzzle answer
Change spooky fishing to fishing spooky
26 files changed, 313 insertions, 217 deletions
@@ -34,11 +34,11 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/lividsolver/oruopuzzle/blazepuzzle/creeperpuzzle/list> - Toggles features. /toggle list returns values of every toggle. +- /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/midasstaffmessages/lividsolver/oruopuzzle/blazepuzzle/creeperpuzzle/list> - Toggles features. /toggle list returns values of every toggle. - /setkey <key> - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot <zombie/spider/wolf/fishing/catacombs> [winter/f(1-6)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display <zombie/spider/wolf/fishing/catacombs/auto/off> [winter/f(1-6)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /loot <zombie/spider/wolf/fishing/catacombs> [winter/spooky/f(1-6)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display <zombie/spider/wolf/fishing/catacombs/auto/off> [winter/spooky/f(1-6)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot <zombie/spider/wolf/fishing/catacombs/confirm/cancel> - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move <coords/display/dungeontimer/skill50/lividhp> <x> <y> - Moves text display to specified X and Y coordinates. - /scale <coords/display/dungeontimer/skill50/lividhp> <scale (0.1 - 10)> - Scales text display to a specified multipler between 0.1x and 10x. diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index e6cbfd0..242cc17 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -148,6 +148,17 @@ public class TheMod static int dungeonDeaths = 0; static int puzzleFails = 0; + public static String MAIN_COLOUR; + public static String SECONDARY_COLOUR; + public static String ERROR_COLOUR; + public static String DELIMITER_COLOUR; + public static String TYPE_COLOUR; + public static String VALUE_COLOUR; + public static String SKILL_AVERAGE_COLOUR; + public static String ANSWER_COLOUR; + public static String SKILL_50_COLOUR; + public static String COORDS_COLOUR; + @EventHandler public void init(FMLInitializationEvent event) { FMLCommonHandler.instance().bus().register(this); @@ -222,7 +233,7 @@ public class TheMod triviaSolutions.put("What is the name of the lady of the Nether?", "Elle"); triviaSolutions.put("Which villager in the Village gives you a Rogue Sword?", "Jamie"); triviaSolutions.put("How many unique minions are there?", "52 Minions"); - triviaSolutions.put("Which of these enemies does not spawn in the Spider's Den?", "Zombie Spider OR Cave Spider OR Broodfather OR Wither Skeleton"); + triviaSolutions.put("Which of these enemies does not spawn in the Spider's Den?", "Zombie Spider OR Cave Spider OR Broodfather OR Wither Skeleton OR Dashing Spooder"); triviaSolutions.put("Which of these monsters only spawns at night?", "Zombie Villager OR Ghast"); triviaSolutions.put("Which of these is not a dragon in The End?", "Zoomer Dragon OR Weak Dragon OR Stonk Dragon OR Holy Dragon OR Boomer Dragon"); @@ -298,7 +309,7 @@ public class TheMod } catch (InterruptedException ex) { System.err.println(ex); } - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + MODID + " is outdated. Please update to " + latestTag + ".\n").appendSibling(update)); + player.addChatMessage(new ChatComponentText(ERROR_COLOUR + MODID + " is outdated. Please update to " + latestTag + ".\n").appendSibling(update)); } }).start(); } @@ -343,7 +354,7 @@ public class TheMod NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); skillTimer = SKILL_TIME; showSkill = true; - skillText = EnumChatFormatting.AQUA + xpGained + " (" + nf.format(currentXp + previousXp) + "/" + nf.format(totalXp) + ") " + percentage + "%"; + skillText = SKILL_50_COLOUR + xpGained + " (" + nf.format(currentXp + previousXp) + "/" + nf.format(totalXp) + ") " + percentage + "%"; } } } @@ -352,10 +363,12 @@ public class TheMod // Replace chat messages with Maddox command List<IChatComponent> chatSiblings = event.message.getSiblings(); - for (IChatComponent sibling : chatSiblings) { - if (sibling.getChatStyle().getChatClickEvent() == null) { - sibling.setChatStyle(sibling.getChatStyle().setChatClickEvent(new ClickEvent(Action.RUN_COMMAND, "/dmodopenmaddoxmenu"))); - } + if (ToggleCommand.trueChatMaddoxEnabled) { + for (IChatComponent sibling : chatSiblings) { + if (sibling.getChatStyle().getChatClickEvent() == null) { + sibling.setChatStyle(sibling.getChatStyle().setChatClickEvent(new ClickEvent(Action.RUN_COMMAND, "/dmodopenmaddoxmenu"))); + } + } } // Dungeon chat spoken by an NPC, containing : @@ -363,7 +376,7 @@ public class TheMod for (String solution : riddleSolutions) { if (message.contains(solution)) { String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_GREEN + "" + EnumChatFormatting.BOLD + npcName + EnumChatFormatting.GREEN + " has the blessing.")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(ANSWER_COLOUR + "" + EnumChatFormatting.BOLD + StringUtils.stripControlCodes(npcName) + MAIN_COLOUR + " has the blessing.")); break; } } @@ -381,7 +394,7 @@ public class TheMod if (ToggleCommand.oruoToggled && Utils.inDungeons) { for (String question : triviaSolutions.keySet()) { if (message.contains(question)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Answer: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + triviaSolutions.get(question))); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(MAIN_COLOUR + "Answer: " + ANSWER_COLOUR + EnumChatFormatting.BOLD + triviaSolutions.get(question))); break; } } @@ -699,12 +712,12 @@ public class TheMod } else if (message.contains("Phew! It's only a Scarecrow")) { lc.scarecrows++; lc.scarecrowsSession++; - cf.writeIntConfig("fishing", "scarecrow", lc.werewolfs); + cf.writeIntConfig("fishing", "scarecrow", lc.scarecrows); increaseSeaCreatures(); } else if (message.contains("You hear trotting from beneath the waves, you caught a Nightmare")) { lc.nightmares++; lc.nightmaresSession++; - cf.writeIntConfig("fishing", "nightmare", lc.werewolfs); + cf.writeIntConfig("fishing", "nightmare", lc.nightmares); increaseSeaCreatures(); } else if (message.contains("It must be a full moon, a Werewolf appears")) { lc.werewolfs++; @@ -714,12 +727,12 @@ public class TheMod } else if (message.contains("The spirit of a long lost Phantom Fisher has come to haunt you")) { lc.phantomFishers++; lc.phantomFishersSession++; - cf.writeIntConfig("fishing", "phantomFisher", lc.werewolfs); + cf.writeIntConfig("fishing", "phantomFisher", lc.phantomFishers); increaseSeaCreatures(); } else if (message.contains("This can't be! The manifestation of death himself")) { lc.grimReapers++; lc.grimReapersSession++; - cf.writeIntConfig("fishing", "grimReaper", lc.werewolfs); + cf.writeIntConfig("fishing", "grimReaper", lc.grimReapers); increaseSeaCreatures(); } else if (message.contains("Dungeon starts in 1 second.")) { // Dungeons Stuff dungeonStartTime = System.currentTimeMillis() / 1000 + 1; @@ -946,7 +959,7 @@ public class TheMod lastMaddoxCommand = sibling.getChatStyle().getChatClickEvent().getValue(); } } - if (tc.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Click anywhere in chat to open Maddox")); + if (tc.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(MAIN_COLOUR + "Click anywhere in chat to open Maddox")); } // Spirit Bear alerts @@ -994,7 +1007,7 @@ public class TheMod xDir = (double) Math.round(xDir * 10d) / 10d; double yDir = (double) Math.round(player.rotationPitch * 10d) / 10d; - String coordText = (int) player.posX + " / " + (int) player.posY + " / " + (int) player.posZ + " (" + xDir + " / " + yDir + ")"; + String coordText = COORDS_COLOUR + (int) player.posX + " / " + (int) player.posY + " / " + (int) player.posZ + " (" + xDir + " / " + yDir + ")"; new TextRenderer(Minecraft.getMinecraft(), coordText, moc.coordsXY[0], moc.coordsXY[1], ScaleCommand.coordsScale); } @@ -1487,7 +1500,7 @@ public class TheMod EnumChatFormatting.BLUE + nf.format(lc.blueSharksSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.tigerSharksSession) + "\n" + EnumChatFormatting.WHITE + nf.format(lc.greatWhiteSharksSession); - } else if (ds.display.equals("spooky_fishing")) { + } else if (ds.display.equals("fishing_spooky")) { dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1506,7 +1519,7 @@ public class TheMod EnumChatFormatting.DARK_PURPLE + nf.format(lc.werewolfs) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.phantomFishers) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.grimReapers); - } else if (ds.display.equals("spooky_fishing_session")) { + } else if (ds.display.equals("fishing_spooky_session")) { dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -2152,7 +2165,7 @@ public class TheMod if (inventoryName.equals("Slayer")) { if (!item.getDisplayName().contains("Revenant Horror") && !item.getDisplayName().contains("Tarantula Broodfather") && !item.getDisplayName().contains("Sven Packmaster")) return; if (!item.getDisplayName().contains(BlockSlayerCommand.onlySlayerName)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + BlockSlayerCommand.onlySlayerName + " " + BlockSlayerCommand.onlySlayerNumber + ")")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + BlockSlayerCommand.onlySlayerName + " " + BlockSlayerCommand.onlySlayerNumber + ")")); Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); event.setCanceled(true); } @@ -2161,7 +2174,7 @@ public class TheMod // Only check number as they passed the above check String slayerNumber = item.getDisplayName().substring(item.getDisplayName().lastIndexOf(" ") + 1, item.getDisplayName().length()); if (!slayerNumber.equals(BlockSlayerCommand.onlySlayerNumber)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + BlockSlayerCommand.onlySlayerName + " " + BlockSlayerCommand.onlySlayerNumber + ")")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + BlockSlayerCommand.onlySlayerName + " " + BlockSlayerCommand.onlySlayerNumber + ")")); Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); event.setCanceled(true); } diff --git a/src/main/java/me/Danker/commands/ArmourCommand.java b/src/main/java/me/Danker/commands/ArmourCommand.java index 4fcd282..44255e8 100644 --- a/src/main/java/me/Danker/commands/ArmourCommand.java +++ b/src/main/java/me/Danker/commands/ArmourCommand.java @@ -9,6 +9,7 @@ import java.util.List; import com.google.gson.JsonObject; +import me.Danker.TheMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; @@ -74,10 +75,10 @@ public class ArmourCommand extends CommandBase { if (arg1.length == 0) { username = player.getName(); uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking armour of " + EnumChatFormatting.DARK_GREEN + username)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking armour of " + TheMod.SECONDARY_COLOUR + username)); } else { username = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking armour of " + EnumChatFormatting.DARK_GREEN + username)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking armour of " + TheMod.SECONDARY_COLOUR + username)); uuid = ah.getUUID(username); } @@ -90,7 +91,7 @@ public class ArmourCommand extends CommandBase { JsonObject profileResponse = ah.getResponse(profileURL); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Failed with reason: " + reason)); return; } @@ -133,15 +134,15 @@ public class ArmourCommand extends CommandBase { } armourStream.close(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.AQUA + " " + username + "'s Armour:\n" + - EnumChatFormatting.GREEN + " Helmet: " + helmet + "\n" + - EnumChatFormatting.GREEN + " Chestplate: " + chest + "\n" + - EnumChatFormatting.GREEN + " Leggings: " + legs + "\n" + - EnumChatFormatting.GREEN + " Boots: " + boots + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); + TheMod.TYPE_COLOUR + " Helmet: " + helmet + "\n" + + TheMod.TYPE_COLOUR + " Chestplate: " + chest + "\n" + + TheMod.TYPE_COLOUR + " Leggings: " + legs + "\n" + + TheMod.TYPE_COLOUR + " Boots: " + boots + "\n" + + TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); } catch (IOException ex) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "An error has occurred while reading inventory data. See logs for more info.")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "An error has occurred while reading inventory data. See logs for more info.")); System.err.println(ex); } }).start(); diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java index 0d9540c..f832a2d 100644 --- a/src/main/java/me/Danker/commands/BankCommand.java +++ b/src/main/java/me/Danker/commands/BankCommand.java @@ -7,6 +7,7 @@ import java.util.Locale; import com.google.gson.JsonObject; +import me.Danker.TheMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; @@ -68,10 +69,10 @@ public class BankCommand extends CommandBase { if (arg1.length == 0) { username = player.getName(); uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking coins of " + EnumChatFormatting.DARK_GREEN + username)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking coins of " + TheMod.SECONDARY_COLOUR + username)); } else { username = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking coins of " + EnumChatFormatting.DARK_GREEN + username)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking coins of " + TheMod.SECONDARY_COLOUR + username)); uuid = ah.getUUID(username); } @@ -98,17 +99,17 @@ public class BankCommand extends CommandBase { double bankCoins = profileResponse.get("profile").getAsJsonObject().get("banking").getAsJsonObject().get("balance").getAsDouble(); bankCoins = (double) Math.floor(bankCoins * 100.0) / 100.0; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + - EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.GOLD + nf.format(bankCoins) + "\n" + - EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); + TheMod.TYPE_COLOUR + " Bank: " + EnumChatFormatting.GOLD + nf.format(bankCoins) + "\n" + + TheMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + + TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + - EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.RED + "Bank API disabled.\n" + - EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); + TheMod.TYPE_COLOUR + " Bank: " + EnumChatFormatting.RED + "Bank API disabled.\n" + + TheMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + + TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); } }).start(); } diff --git a/src/main/java/me/Danker/commands/BlockSlayerCommand.java b/src/main/java/me/Danker/commands/BlockSlayerCommand.java index 83a0358..bc6a32b 100644 --- a/src/main/java/me/Danker/commands/BlockSlayerCommand.java +++ b/src/main/java/me/Danker/commands/BlockSlayerCommand.java @@ -2,6 +2,7 @@ package me.Danker.commands; import java.util.List; +import me.Danker.TheMod; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -47,7 +48,7 @@ public class BlockSlayerCommand extends CommandBase { final ConfigHandler cf = new ConfigHandler(); if (arg1.length == 0 || (arg1.length == 1 && !arg1[0].equalsIgnoreCase("off"))) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; } @@ -61,10 +62,10 @@ public class BlockSlayerCommand extends CommandBase { onlySlayerName = ""; onlySlayerNumber = ""; cf.writeStringConfig("toggles", "BlockSlayer", ""); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Slayer blocking turned off.")); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Slayer blocking turned off.")); return; } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; } @@ -86,12 +87,12 @@ public class BlockSlayerCommand extends CommandBase { default: onlySlayerName = ""; onlySlayerNumber = ""; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; } cf.writeStringConfig("toggles", "BlockSlayer", onlySlayerName + " " + onlySlayerNumber); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Slayer blocking set to " + EnumChatFormatting.DARK_GREEN + onlySlayerName + " " + onlySlayerNumber)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Slayer blocking set to " + TheMod.SECONDARY_COLOUR + onlySlayerName + " " + onlySlayerNumber)); } } diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index ee4422f..6e00fba 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -2,6 +2,7 @@ package me.Danker.commands; import java.util.List; +import me.Danker.TheMod; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -49,7 +50,7 @@ public class DisplayCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; } @@ -91,9 +92,9 @@ public class DisplayCommand extends CommandBase { } } else if (arg1.length > 1 && arg1[1].equalsIgnoreCase("spooky")) { if (showSession) { - display = "spooky_fishing_session"; + display = "fishing_spooky_session"; } else { - display = "spooky_fishing"; + display = "fishing_spooky"; } } else { if (showSession) { @@ -104,7 +105,7 @@ public class DisplayCommand extends CommandBase { } } else if (arg1[0].equalsIgnoreCase("catacombs")) { if (arg1.length == 1) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display catacombs <f1/f2/f3/f4>")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: /display catacombs <f1/f2/f3/f4>")); return; } if (arg1[1].equalsIgnoreCase("f1") || arg1[1].equalsIgnoreCase("floor1")) { @@ -144,22 +145,22 @@ public class DisplayCommand extends CommandBase { display = "catacombs_floor_six"; } } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display catacombs <f1/f2/f3/f4/f5/f6>")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: /display catacombs <f1/f2/f3/f4/f5/f6>")); return; } } else if (arg1[0].equalsIgnoreCase("auto")) { auto = true; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + "auto" + EnumChatFormatting.GREEN + ".")); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Display set to " + TheMod.SECONDARY_COLOUR + "auto" + TheMod.MAIN_COLOUR + ".")); cf.writeBooleanConfig("misc", "autoDisplay", true); return; } else if (arg1[0].equalsIgnoreCase("off")) { display = "off"; } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; } auto = false; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + display + EnumChatFormatting.GREEN + ".")); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Display set to " + TheMod.SECONDARY_COLOUR + display + TheMod.MAIN_COLOUR + ".")); cf.writeBooleanConfig("misc", "autoDisplay", false); cf.writeStringConfig("misc", "display", display); } diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 251cf3d..7a57400 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -4,6 +4,7 @@ import java.util.List; import com.google.gson.JsonObject; +import me.Danker.TheMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; @@ -51,7 +52,7 @@ public class DungeonsCommand extends CommandBase { // Check key String key = cf.getString("api", "APIKey"); if (key.equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "API key not set. Use /setkey.")); } // Get UUID for Hypixel API requests @@ -60,10 +61,10 @@ public class DungeonsCommand extends CommandBase { if (arg1.length == 0) { username = player.getName(); uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking dungeon stats of " + EnumChatFormatting.DARK_GREEN + username)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking dungeon stats of " + TheMod.SECONDARY_COLOUR + username)); } else { username = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking dungeon stats of " + EnumChatFormatting.DARK_GREEN + username)); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking dungeon stats of " + TheMod.SECONDARY_COLOUR + username)); uuid = ah.getUUID(username); } @@ -76,14 +77,14 @@ public class DungeonsCommand extends CommandBase { JsonObject profileResponse = ah.getResponse(profileURL); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Failed with reason: " + reason)); return; } System.out.println("Fetching dungeon stats..."); JsonObject dungeonsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("dungeons").getAsJsonObject(); if (!dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject().has("experience")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "This player has not played dungeons.")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "This player has not played dungeons.")); return; } @@ -95,7 +96,7 @@ public class DungeonsCommand extends CommandBase { double tank = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()); String selectedClass = Utils.capitalizeString(dungeonsObject.get("selected_dungeon_class").getAsString()); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + @@ -103,7 +104,7 @@ public class DungeonsCommand extends CommandBase { EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); + TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); }).start(); } diff --git a/src/main/java/me/Danker/commands/GetkeyCommand.java b/src/main/java/me/Danker/commands/GetkeyCommand.java index 8a650de..32fa6df 100644 --- a/src/main/java/me/Danker/commands/GetkeyCommand.java +++ b/src/main/java/me/Danker/commands/GetkeyCommand.java @@ -4,6 +4,7 @@ import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; +import me.Danker.TheMod; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -38,12 +39,12 @@ public class GetkeyCommand extends CommandBase implements ICommand { StringSelection stringSelection = new StringSelection(cf.getString("api", "APIKey")); if (cf.getString("api", "APIKey").equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey.")); + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "API key not set. Set your API key using /setkey.")); } clipboard.setContents(stringSelection, null); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey") + "\n" + - EnumChatFormatting.GREEN + "Your set API key has been copied to the clipboard.")); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Your set API key is " + TheMod.SECONDARY_COLOUR + cf.getString("api", "APIKey") + "\n" + + TheMod.MAIN_COLOUR + " Your set API key has been copied to the clipboard.")); } diff --git a/src/main/java/me/Danker/commands/GuildOfCommand.java b/src/main/java/me/Danker/commands/GuildOfCommand.java index be804c1..44fb783 100644 --- a/src/main/java/me/Danker/commands/GuildOfCommand.java +++ b/src/main/java/me/Danker/commands/GuildOfCommand.java @@ -6,6 +6,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import me.Danker.TheMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; @@ -53,7 +54,7 @@ public class GuildOfCommand extends CommandBase { // Check key String key = cf.getString("api", "APIKey"); if (key.equals("")) { |
