diff options
Diffstat (limited to 'src/main/java/me/Danker/commands')
7 files changed, 342 insertions, 18 deletions
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 207e700..f12d0ee 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -50,12 +50,14 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + PetsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get pets of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + BankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + ArmourCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + DungeonHub.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get dungeon levels of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + EnumChatFormatting.GOLD + CustomMusicCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + + EnumChatFormatting.GOLD + PlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find skills, slayers, coins and weight of a player.\n" + EnumChatFormatting.GOLD + Crypt.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Crypt in the Hub. \n" + EnumChatFormatting.GOLD + DarkAuction.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dark Auction in the Hub. \n" + EnumChatFormatting.GOLD + Dragon.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dragons Nest in the End. \n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 5076ef7..6f548fa 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -88,7 +88,13 @@ public class DankerGuiCommand extends CommandBase { debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); debug.append("[hidetooltipsinaddons][").append(ToggleCommand.hideTooltipsInExperimentAddonsToggled).append("]\n"); debug.append("[pickblock][").append(ToggleCommand.swapToPickBlockToggled).append("]\n"); - debug.append("[melodyTooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); + debug.append("[melodytooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); + debug.append("[highlightslayers][").append(ToggleCommand.highlightSlayers).append("]\n"); + debug.append("[highlightarachne][").append(ToggleCommand.highlightArachne).append("]\n"); + debug.append("[highlightskeletonmasters][").append(ToggleCommand.highlightSkeletonMasters).append("]\n"); + debug.append("[teammatesinradius][").append(ToggleCommand.teammatesInRadius).append("]\n"); + debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); + debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 6fe2939..b17794c 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -23,6 +23,8 @@ public class MoveCommand extends CommandBase { public static int[] waterAnswerXY = {0, 0}; public static int[] bonzoTimerXY = {0, 0}; public static int[] golemTimerXY = {0 ,0}; + public static int[] teammatesInRadiusXY = {0, 0}; + public static int[] giantHPXY = {0, 0}; @Override public String getCommandName() { @@ -31,7 +33,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer> <x> <y>"; + return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer/teammatesinradius/gianthp> <x> <y>"; } public static String usage(ICommandSender arg0) { @@ -46,7 +48,9 @@ public class MoveCommand extends CommandBase { @Override public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", + "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", + "gianthp"); } return null; } @@ -131,6 +135,20 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "golemTimerY", golemTimerXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Golem timer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "teammatesinradius": + teammatesInRadiusXY[0] = Integer.parseInt(arg1[1]); + teammatesInRadiusXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusX", teammatesInRadiusXY[0]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", teammatesInRadiusXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; + case "gianthp": + giantHPXY[0] = Integer.parseInt(arg1[1]); + giantHPXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "giantHPX", giantHPXY[0]); + ConfigHandler.writeIntConfig("locations", "giantHPY", giantHPXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant HP has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/PlayerCommand.java b/src/main/java/me/Danker/commands/PlayerCommand.java new file mode 100644 index 0000000..ef0ed4c --- /dev/null +++ b/src/main/java/me/Danker/commands/PlayerCommand.java @@ -0,0 +1,252 @@ +package me.Danker.commands; + +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.List; +import java.util.Locale; + +public class PlayerCommand extends CommandBase { + + @Override + public String getCommandName() { + return "player"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new SkillsCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + // Find stats of latest profile + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + // Skills + System.out.println("Fetching skills..."); + JsonObject userObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject(); + + double farmingLevel = 0; + double miningLevel = 0; + double combatLevel = 0; + double foragingLevel = 0; + double fishingLevel = 0; + double enchantingLevel = 0; + double alchemyLevel = 0; + double tamingLevel = 0; + + if (userObject.has("experience_skill_farming") || userObject.has("experience_skill_mining") || userObject.has("experience_skill_combat") || userObject.has("experience_skill_foraging") || userObject.has("experience_skill_fishing") || userObject.has("experience_skill_enchanting") || userObject.has("experience_skill_alchemy")) { + if (userObject.has("experience_skill_farming")) { + farmingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_farming").getAsDouble(), 60); + farmingLevel = (double) Math.round(farmingLevel * 100) / 100; + } + if (userObject.has("experience_skill_mining")) { + miningLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_mining").getAsDouble(), 60); + miningLevel = (double) Math.round(miningLevel * 100) / 100; + } + if (userObject.has("experience_skill_combat")) { + combatLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_combat").getAsDouble(), 60); + combatLevel = (double) Math.round(combatLevel * 100) / 100; + } + if (userObject.has("experience_skill_foraging")) { + foragingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_foraging").getAsDouble(), 50); + foragingLevel = (double) Math.round(foragingLevel * 100) / 100; + } + if (userObject.has("experience_skill_fishing")) { + fishingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_fishing").getAsDouble(), 50); + fishingLevel = (double) Math.round(fishingLevel * 100) / 100; + } + if (userObject.has("experience_skill_enchanting")) { + enchantingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_enchanting").getAsDouble(), 60); + enchantingLevel = (double) Math.round(enchantingLevel * 100) / 100; + } + if (userObject.has("experience_skill_alchemy")) { + alchemyLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_alchemy").getAsDouble(), 50); + alchemyLevel = (double) Math.round(alchemyLevel * 100) / 100; + } + if (userObject.has("experience_skill_taming")) { + tamingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_taming").getAsDouble(), 50); + tamingLevel = (double) Math.round(tamingLevel * 100) / 100; + } + } else { + // Get skills from achievement API, will be floored + + String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; + System.out.println("Fetching skills from achievement API"); + JsonObject playerObject = APIHandler.getResponse(playerURL); + + if (!playerObject.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + JsonObject achievementObject = playerObject.get("player").getAsJsonObject().get("achievements").getAsJsonObject(); + if (achievementObject.has("skyblock_harvester")) { + farmingLevel = achievementObject.get("skyblock_harvester").getAsInt(); + } + if (achievementObject.has("skyblock_excavator")) { + miningLevel = achievementObject.get("skyblock_excavator").getAsInt(); + } + if (achievementObject.has("skyblock_combat")) { + combatLevel = achievementObject.get("skyblock_combat").getAsInt(); + } + if (achievementObject.has("skyblock_gatherer")) { + foragingLevel = Math.min(achievementObject.get("skyblock_gatherer").getAsInt(), 50); + } + if (achievementObject.has("skyblock_angler")) { + fishingLevel = Math.min(achievementObject.get("skyblock_angler").getAsInt(), 50); + } + if (achievementObject.has("skyblock_augmentation")) { + enchantingLevel = achievementObject.get("skyblock_augmentation").getAsInt(); + } + if (achievementObject.has("skyblock_concoctor")) { + alchemyLevel = Math.min(achievementObject.get("skyblock_concoctor").getAsInt(), 50); + } + if (achievementObject.has("skyblock_domesticator")) { + tamingLevel = Math.min(achievementObject.get("skyblock_domesticator").getAsInt(), 50); + } + } + + double skillAvg = (farmingLevel + miningLevel + combatLevel + foragingLevel + fishingLevel + enchantingLevel + alchemyLevel + tamingLevel) / 8; + skillAvg = (double) Math.round(skillAvg * 100) / 100; + double trueAvg = (Math.floor(farmingLevel) + Math.floor(miningLevel) + Math.floor(combatLevel) + Math.floor(foragingLevel) + Math.floor(fishingLevel) + Math.floor(enchantingLevel) + Math.floor(alchemyLevel) + Math.floor(tamingLevel)) / 8; + + // Slayers + System.out.println("Fetching slayer stats..."); + JsonObject slayersObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("slayer_bosses").getAsJsonObject(); + // Zombie + int zombieXP = 0; + if (slayersObject.get("zombie").getAsJsonObject().has("xp")) { + zombieXP = slayersObject.get("zombie").getAsJsonObject().get("xp").getAsInt(); + } + // Spider + int spiderXP = 0; + if (slayersObject.get("spider").getAsJsonObject().has("xp")) { + spiderXP = slayersObject.get("spider").getAsJsonObject().get("xp").getAsInt(); + } + // Wolf + int wolfXP = 0; + if (slayersObject.get("wolf").getAsJsonObject().has("xp")) { + wolfXP = slayersObject.get("wolf").getAsJsonObject().get("xp").getAsInt(); + } + + // Bank + System.out.println("Fetching bank + purse coins..."); + double bankCoins = 0; + double purseCoins = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("coin_purse").getAsDouble(); + purseCoins = Math.floor(purseCoins * 100.0) / 100.0; + + // Check for bank api + if (profileResponse.get("profile").getAsJsonObject().has("banking")) { + bankCoins = profileResponse.get("profile").getAsJsonObject().get("banking").getAsJsonObject().get("balance").getAsDouble(); + bankCoins = Math.floor(bankCoins * 100.0) / 100.0; + } + + // Weight + System.out.println("Fetching weight from Senither API..."); + String weightURL = "https://hypixel-api.senither.com/v1/profiles/" + uuid + "/weight?key=" + key; + JsonObject weightResponse = APIHandler.getResponse(weightURL); + if (weightResponse.get("status").getAsInt() != 200) { + String reason = weightResponse.get("reason").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + double weight = weightResponse.get("data").getAsJsonObject().get("weight").getAsDouble(); + double overflow = weightResponse.get("data").getAsJsonObject().get("weight_overflow").getAsDouble(); + + NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); + NumberFormat nfd = NumberFormat.getNumberInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + " " + username + "'s Skills:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Farming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + farmingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Mining: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + miningLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Combat: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + combatLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Foraging: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + foragingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Fishing: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + fishingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Enchanting: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + enchantingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Alchemy: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + alchemyLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Taming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + tamingLevel + "\n" + + EnumChatFormatting.AQUA + " Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + skillAvg + "\n" + + EnumChatFormatting.AQUA + " True Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + trueAvg + "\n\n" + + EnumChatFormatting.AQUA + " " + username + "'s Total Slayer XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Zombie XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Spider XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n\n" + + EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Bank: " + (bankCoins == 0 ? EnumChatFormatting.RED + "Bank API disabled." : EnumChatFormatting.GOLD + nf.format(bankCoins)) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total: " + EnumChatFormatting.GOLD + nf.format(bankCoins + purseCoins) + "\n\n" + + EnumChatFormatting.AQUA + " " + username + "'s Weight:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nfd.format(weight + overflow) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Weight: " + DankersSkyblockMod.VALUE_COLOUR + nfd.format(weight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Overflow: " + DankersSkyblockMod.VALUE_COLOUR + nfd.format(overflow) + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + }).start(); + } + +} diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index b27ac50..def0e57 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -23,6 +23,8 @@ public class ScaleCommand extends CommandBase { public static double waterAnswerScale; public static double bonzoTimerScale; public static double golemTimerScale; + public static double teammatesInRadiusScale; + public static double giantHPScale; @Override public String getCommandName() { @@ -31,7 +33,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer> <size (0.1 - 10)>"; + return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer/teammatesinradius/gianthp> <size (0.1 - 10)>"; } public static String usage(ICommandSender arg0) { @@ -46,7 +48,9 @@ public class ScaleCommand extends CommandBase { @Override public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", + "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", + "gianthp"); } return null; } @@ -117,6 +121,16 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "golemTimerScale", golemTimerScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Golem timer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + golemTimerScale + "x")); break; + case "teammatesinradius": + teammatesInRadiusScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "teammatesInRadiusScale", teammatesInRadiusScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + teammatesInRadiusScale + "x")); + break; + case "gianthp": + giantHPScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "giantHPScale", giantHPScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant hp has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + giantHPScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index a17fedb..6195e81 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -19,7 +19,7 @@ public class SkillsCommand extends CommandBase { @Override public String getCommandName() { - return "skills"; + return "skill"; } @Override diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index b9c52e7..c04e0a8 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -33,6 +33,10 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cakeTimerToggled; public static boolean highlightSlayers; public static boolean highlightArachne; + public static boolean highlightSkeletonMasters; + public static boolean teammatesInRadius; + public static boolean giantHP; + public static boolean hidePetCandy; public static boolean highlightCommissions; // Chat Messages public static boolean sceptreMessages; @@ -93,8 +97,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + - "melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + - "dungeonmusic/highlightcommissions/list>"; + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + + "gianthp/hidepetcandy/dungeonbossmusic/bloodroommusic/dungeonmusic/highlightcommissions/list>"; } public static String usage(ICommandSender arg0) { @@ -122,7 +126,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", - "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "highlightcommissions", "list"); + "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", + "teammatesinradius", "gianthp", "hidepetcandy", "highlightcommissions", "list"); } return null; } @@ -386,21 +391,43 @@ public class ToggleCommand extends CommandBase implements ICommand { case "melodytooltips": melodyTooltips = !melodyTooltips; ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", melodyTooltips); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "highlightslayers": highlightSlayers = !highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "highlightArachne": + case "highlightarachne": highlightArachne = !highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "highlightskeletonmasters": + highlightSkeletonMasters = !highlightSkeletonMasters; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSkeletonMasters", highlightSkeletonMasters); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Skeleton Masters has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSkeletonMasters + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "teammatesinradius": + teammatesInRadius = !teammatesInRadius; + ConfigHandler.writeBooleanConfig("toggles", "TeammatesInRadius", teammatesInRadius); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + teammatesInRadius + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "gianthp": + giantHP = !giantHP; + ConfigHandler.writeBooleanConfig("toggles", "GiantHP", giantHP); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant HP display has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + giantHP + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "hidepetcandy": + hidePetCandy = !hidePetCandy; + ConfigHandler.writeBooleanConfig("toggles", "HidePetCandy", hidePetCandy); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide pet candy has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + hidePetCandy + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "highlightcommissions": highlightCommissions = !highlightCommissions; ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", highlightCommissions); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Commissions " + DankersSkyblockMod.SECONDARY_COLOUR + highlightCommissions + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Commissions has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightCommissions + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -460,10 +487,15 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block: " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp: " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses: " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss: " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Skeleton Masters: " + DankersSkyblockMod.VALUE_COLOUR + highlightSkeletonMasters + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Teammates in radius: " + DankersSkyblockMod.VALUE_COLOUR + teammatesInRadius + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Giant HP display: " + DankersSkyblockMod.VALUE_COLOUR + giantHP + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Hide pet candy: " + DankersSkyblockMod.VALUE_COLOUR + hidePetCandy + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight commissions: " + DankersSkyblockMod.VALUE_COLOUR + highlightCommissions + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic |