From fddf14fd04c50e02704c946d8893a3604f1abb11 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 8 Aug 2020 23:07:53 -0400 Subject: v1.6.1 Add all build files --- me/Danker/commands/ArmourCommand.java | 150 -------- me/Danker/commands/BankCommand.java | 115 ------ me/Danker/commands/DHelpCommand.java | 52 --- me/Danker/commands/DisplayCommand.java | 108 ------ me/Danker/commands/GetkeyCommand.java | 41 --- me/Danker/commands/GuildOfCommand.java | 116 ------ me/Danker/commands/ImportFishingCommand.java | 233 ------------ me/Danker/commands/LootCommand.java | 533 --------------------------- me/Danker/commands/MoveCommand.java | 69 ---- me/Danker/commands/PetsCommand.java | 247 ------------- me/Danker/commands/ReloadConfigCommand.java | 36 -- me/Danker/commands/ResetLootCommand.java | 181 --------- me/Danker/commands/ScaleCommand.java | 70 ---- me/Danker/commands/SetkeyCommand.java | 43 --- me/Danker/commands/SkillsCommand.java | 334 ----------------- me/Danker/commands/SlayerCommand.java | 112 ------ me/Danker/commands/ToggleCommand.java | 83 ----- 17 files changed, 2523 deletions(-) delete mode 100644 me/Danker/commands/ArmourCommand.java delete mode 100644 me/Danker/commands/BankCommand.java delete mode 100644 me/Danker/commands/DHelpCommand.java delete mode 100644 me/Danker/commands/DisplayCommand.java delete mode 100644 me/Danker/commands/GetkeyCommand.java delete mode 100644 me/Danker/commands/GuildOfCommand.java delete mode 100644 me/Danker/commands/ImportFishingCommand.java delete mode 100644 me/Danker/commands/LootCommand.java delete mode 100644 me/Danker/commands/MoveCommand.java delete mode 100644 me/Danker/commands/PetsCommand.java delete mode 100644 me/Danker/commands/ReloadConfigCommand.java delete mode 100644 me/Danker/commands/ResetLootCommand.java delete mode 100644 me/Danker/commands/ScaleCommand.java delete mode 100644 me/Danker/commands/SetkeyCommand.java delete mode 100644 me/Danker/commands/SkillsCommand.java delete mode 100644 me/Danker/commands/SlayerCommand.java delete mode 100644 me/Danker/commands/ToggleCommand.java (limited to 'me/Danker/commands') diff --git a/me/Danker/commands/ArmourCommand.java b/me/Danker/commands/ArmourCommand.java deleted file mode 100644 index 255825c..0000000 --- a/me/Danker/commands/ArmourCommand.java +++ /dev/null @@ -1,150 +0,0 @@ -package me.Danker.commands; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Base64; -import java.util.Collections; -import java.util.List; - -import com.google.gson.JsonObject; - -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.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -public class ArmourCommand extends CommandBase { - - @Override - public String getCommandName() { - return "armor"; - } - - @Override - public List getCommandAliases() - { - return Collections.singletonList("armour"); - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " [name]"; - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List 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(() -> { - APIHandler ah = new APIHandler(); - ConfigHandler cf = new ConfigHandler(); - EntityPlayer player = (EntityPlayer) arg0; - - // Check key - String key = cf.getString("api", "APIKey"); - if (key.equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); - } - - // 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(EnumChatFormatting.GREEN + "Checking armour of " + EnumChatFormatting.DARK_GREEN + username)); - } else { - username = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking armour of " + EnumChatFormatting.DARK_GREEN + username)); - uuid = ah.getUUID(username); - } - - // Find stats of latest profile - String latestProfile = ah.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 = ah.getResponse(profileURL); - if (!profileResponse.get("success").getAsBoolean()) { - String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); - return; - } - - String armourBase64 = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("inv_armor").getAsJsonObject().get("data").getAsString(); - InputStream armourStream = new ByteArrayInputStream(Base64.getDecoder().decode(armourBase64)); - // String armourDecodedGZIP = new String(Base64.getDecoder().decode(armourBase64)); - - try { - NBTTagCompound armour = CompressedStreamTools.readCompressed(armourStream); - NBTTagList armourList = armour.getTagList("i", 10); - - String helmet = EnumChatFormatting.RED + "None"; - String chest = EnumChatFormatting.RED + "None"; - String legs = EnumChatFormatting.RED + "None"; - String boots = EnumChatFormatting.RED + "None"; - // Loop through armour - for (int i = 0; i < armourList.tagCount(); i++) { - NBTTagCompound armourPiece = armourList.getCompoundTagAt(i); - if (armourPiece.hasNoTags()) continue; - - String armourPieceName = armourPiece.getCompoundTag("tag").getCompoundTag("display").getString("Name"); - // NBT is served boots -> helmet - switch (i) { - case 0: - boots = armourPieceName; - break; - case 1: - legs = armourPieceName; - break; - case 2: - chest = armourPieceName; - break; - case 3: - helmet = armourPieceName; - break; - default: - System.err.println("An error has occurred."); - break; - } - } - armourStream.close(); - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + 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 + "-------------------")); - } catch (IOException ex) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "An error has occurred while reading inventory data. See logs for more info.")); - System.err.println(ex); - } - }).start(); - } - -} diff --git a/me/Danker/commands/BankCommand.java b/me/Danker/commands/BankCommand.java deleted file mode 100644 index e32e66f..0000000 --- a/me/Danker/commands/BankCommand.java +++ /dev/null @@ -1,115 +0,0 @@ -package me.Danker.commands; - -import java.text.NumberFormat; -import java.util.Collections; -import java.util.List; - -import com.google.gson.JsonObject; - -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; - -public class BankCommand extends CommandBase { - - @Override - public String getCommandName() { - return "bank"; - } - - @Override - public List getCommandAliases() - { - return Collections.singletonList("purse"); - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " [name]"; - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List 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(() -> { - APIHandler ah = new APIHandler(); - ConfigHandler cf = new ConfigHandler(); - EntityPlayer player = (EntityPlayer) arg0; - - // Check key - String key = cf.getString("api", "APIKey"); - if (key.equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); - } - - // 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(EnumChatFormatting.GREEN + "Checking coins of " + EnumChatFormatting.DARK_GREEN + username)); - } else { - username = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking coins of " + EnumChatFormatting.DARK_GREEN + username)); - uuid = ah.getUUID(username); - } - - // Find stats of latest profile - String latestProfile = ah.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 = ah.getResponse(profileURL); - if (!profileResponse.get("success").getAsBoolean()) { - String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); - return; - } - - System.out.println("Fetching bank + purse coins..."); - double purseCoins = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("coin_purse").getAsDouble(); - purseCoins = (double) Math.floor(purseCoins * 100.0) / 100.0; - - // Check for bank api - if (profileResponse.get("profile").getAsJsonObject().has("banking")) { - 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" + - EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + - EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.GOLD + NumberFormat.getInstance().format(bankCoins) + "\n" + - EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + NumberFormat.getInstance().format(purseCoins) + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + - EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.RED + "Bank API disabled.\n" + - EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + NumberFormat.getInstance().format(purseCoins) + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); - } - }).start(); - } - -} diff --git a/me/Danker/commands/DHelpCommand.java b/me/Danker/commands/DHelpCommand.java deleted file mode 100644 index 9ca6a6e..0000000 --- a/me/Danker/commands/DHelpCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -package me.Danker.commands; - -import me.Danker.TheMod; -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.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -public class DHelpCommand extends CommandBase { - - @Override - public String getCommandName() { - return "dhelp"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName(); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - EntityPlayer player = (EntityPlayer) arg0; - - player.addChatMessage(new ChatComponentText("\n" + EnumChatFormatting.GOLD + " " + TheMod.MODID + " Version " + TheMod.VERSION + "\n" + - EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" + - EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + - EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + - EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" + - EnumChatFormatting.GOLD + " /loot [winter/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + - EnumChatFormatting.GOLD + " /display [winter/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" + - EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + - EnumChatFormatting.GOLD + " /move " + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + - EnumChatFormatting.GOLD + " /scale [winter/session]"; - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "off"); - } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "session"); - } else if (args.length == 2 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { - return getListOfStringsMatchingLastWord(args, "session"); - } - return null; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - final EntityPlayer player = (EntityPlayer) arg0; - - if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display [winter/session]")); - return; - } - - final ConfigHandler cf = new ConfigHandler(); - boolean showSession = false; - - if (arg1.length > 1) { - if (arg1[1].equalsIgnoreCase("session")) { - showSession = true; - } else if (arg1.length > 2) { - if (arg1[2].equalsIgnoreCase("session")) { - showSession = true; - } - } - } - - if (arg1[0].equalsIgnoreCase("wolf")) { - if (showSession) { - display = "wolf_session"; - } else { - display = "wolf"; - } - } else if (arg1[0].equalsIgnoreCase("spider")) { - if (showSession) { - display = "spider_session"; - } else { - display = "spider"; - } - } else if (arg1[0].equalsIgnoreCase("zombie")) { - if (showSession) { - display = "zombie_session"; - } else { - display = "zombie"; - } - } else if (arg1[0].equalsIgnoreCase("fishing")) { - if (arg1.length > 1 && arg1[1].equalsIgnoreCase("winter")) { - if (showSession) { - display = "fishing_winter_session"; - } else { - display = "fishing_winter"; - } - } else { - if (showSession) { - display = "fishing_session"; - } else { - display = "fishing"; - } - } - } else if (arg1[0].equalsIgnoreCase("off")) { - display = "off"; - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display [winter/session]")); - return; - } - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + display + EnumChatFormatting.GREEN + ".")); - cf.writeStringConfig("misc", "display", display); - } - -} diff --git a/me/Danker/commands/GetkeyCommand.java b/me/Danker/commands/GetkeyCommand.java deleted file mode 100644 index 80354fe..0000000 --- a/me/Danker/commands/GetkeyCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -package me.Danker.commands; - -import me.Danker.handlers.ConfigHandler; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -public class GetkeyCommand extends CommandBase implements ICommand { - - @Override - public String getCommandName() { - return "getkey"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName(); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - final EntityPlayer player = (EntityPlayer)arg0; - final ConfigHandler cf = new ConfigHandler(); - - if (cf.getString("api", "APIKey").equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey.")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey"))); - } - } - -} diff --git a/me/Danker/commands/GuildOfCommand.java b/me/Danker/commands/GuildOfCommand.java deleted file mode 100644 index 238ba81..0000000 --- a/me/Danker/commands/GuildOfCommand.java +++ /dev/null @@ -1,116 +0,0 @@ -package me.Danker.commands; - -import java.util.List; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -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; - -public class GuildOfCommand extends CommandBase { - - @Override - public String getCommandName() { - return "guildof"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " [name]"; - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List 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(() -> { - APIHandler ah = new APIHandler(); - ConfigHandler cf = new ConfigHandler(); - EntityPlayer player = (EntityPlayer) arg0; - - // Check key - String key = cf.getString("api", "APIKey"); - if (key.equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); - } - - // 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(EnumChatFormatting.GREEN + "Checking guild of " + EnumChatFormatting.DARK_GREEN + username)); - } else { - username = arg1[0]; - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Checking guild of " + EnumChatFormatting.DARK_GREEN + username)); - uuid = ah.getUUID(username); - } - - // Find guild ID - System.out.println("Fetching guild..."); - String guildURL = "https://api.hypixel.net/guild?player=" + uuid + "&key=" + key; - JsonObject guildResponse = ah.getResponse(guildURL); - if (!guildResponse.get("success").getAsBoolean()) { - String reason = guildResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); - return; - } - - System.out.println("Fetching guild stats and members..."); - - String guildName = "N/A"; - String guildMaster = "N/A"; - // Check if player is in guild - if (!guildResponse.get("guild").isJsonNull()) { - guildName = guildResponse.get("guild").getAsJsonObject().get("name").getAsString(); - - // Loop through members to find guildmaster - JsonArray guildMembers = guildResponse.get("guild").getAsJsonObject().get("members").getAsJsonArray(); - for (JsonElement member : guildMembers) { - JsonObject memberObject = member.getAsJsonObject(); - String memberRank = memberObject.get("rank").getAsString(); - - if (memberRank.equals("GUILDMASTER") || memberRank.equals("Guild Master")) { - // Get username from UUID - String gmUUID = memberObject.get("uuid").getAsString(); - String gmNameURL = "https://api.mojang.com/user/profiles/" + gmUUID + "/names"; - JsonArray gmNameResponse = ah.getArrayResponse(gmNameURL); - - guildMaster = gmNameResponse.get(gmNameResponse.size() - 1).getAsJsonObject().get("name").getAsString(); - break; - } - } - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + " " + username + "'s Guild:\n" + - EnumChatFormatting.GREEN + " Guild: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + guildName + "\n" + - EnumChatFormatting.GREEN + " Guildmaster: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + guildMaster + "\n" + - EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------")); - }).start(); - } - -} diff --git a/me/Danker/commands/ImportFishingCommand.java b/me/Danker/commands/ImportFishingCommand.java deleted file mode 100644 index bbbcb9f..0000000 --- a/me/Danker/commands/ImportFishingCommand.java +++ /dev/null @@ -1,233 +0,0 @@ -package me.Danker.commands; - -import com.google.gson.JsonObject; - -import me.Danker.handlers.APIHandler; -import me.Danker.handlers.ConfigHandler; -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.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -public class ImportFishingCommand extends CommandBase { - - @Override - public String getCommandName() { - return "importfishing"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName(); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - // MULTI THREAD DRIFTING - new Thread(() -> { - APIHandler ah = new APIHandler(); - LootCommand lc = new LootCommand(); - ConfigHandler cf = new ConfigHandler(); - EntityPlayer player = (EntityPlayer) arg0; - - // 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(EnumChatFormatting.GREEN + "Importing your fishing stats...")); - - // Get UUID for Hypixel API requests - String username = player.getName(); - String uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - - String latestProfile = ah.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 = ah.getResponse(profileURL); - if (!profileResponse.get("success").getAsBoolean()) { - String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); - return; - } - - System.out.println("Fetching fishing stats..."); - JsonObject statsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("stats").getAsJsonObject(); - - lc.greatCatches = 0; - lc.goodCatches = 0; - if (statsObject.has("items_fished_treasure")) { - if (statsObject.has("items_fished_large_treasure")) { - lc.greatCatches = statsObject.get("items_fished_large_treasure").getAsInt(); - lc.goodCatches = statsObject.get("items_fished_treasure").getAsInt() - lc.greatCatches; - } else { - lc.goodCatches = statsObject.get("items_fished_treasure").getAsInt(); - } - } - - lc.seaCreatures = 0; - lc.squids = 0; - if (statsObject.has("kills_pond_squid")) { - lc.squids = statsObject.get("kills_pond_squid").getAsInt(); - } - lc.seaCreatures += lc.squids; - - lc.seaWalkers = 0; - if (statsObject.has("kills_sea_walker")) { - lc.seaWalkers = statsObject.get("kills_sea_walker").getAsInt(); - } - lc.seaCreatures += lc.seaWalkers; - - lc.nightSquids = 0; - if (statsObject.has("kills_night_squid")) { - lc.nightSquids = statsObject.get("kills_night_squid").getAsInt(); - } - lc.seaCreatures += lc.nightSquids; - - lc.seaGuardians = 0; - if (statsObject.has("kills_sea_guardian")) { - lc.seaGuardians = statsObject.get("kills_sea_guardian").getAsInt(); - } - lc.seaCreatures += lc.seaGuardians; - - lc.seaWitches = 0; - if (statsObject.has("kills_sea_witch")) { - lc.seaWitches = statsObject.get("kills_sea_witch").getAsInt(); - } - lc.seaCreatures += lc.seaWitches; - - lc.seaArchers = 0; - if (statsObject.has("kills_sea_archer")) { - lc.seaArchers = statsObject.get("kills_sea_archer").getAsInt(); - } - lc.seaCreatures += lc.seaArchers; - - lc.monsterOfTheDeeps = 0; - if (statsObject.has("kills_zombie_deep")) { - if (statsObject.has("kills_chicken_deep")) { - lc.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt() + statsObject.get("kills_chicken_deep").getAsInt(); - } else { - lc.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt(); - } - } else if (statsObject.has("kills_chicken_deep")) { - lc.monsterOfTheDeeps = statsObject.get("kills_chicken_deep").getAsInt(); - } - lc.seaCreatures += lc.monsterOfTheDeeps; - - lc.catfishes = 0; - if (statsObject.has("kills_catfish")) { - lc.catfishes = statsObject.get("kills_catfish").getAsInt(); - } - lc.seaCreatures += lc.catfishes; - - lc.carrotKings = 0; - if (statsObject.has("kills_carrot_king")) { - lc.carrotKings = statsObject.get("kills_carrot_king").getAsInt(); - } - lc.seaCreatures += lc.carrotKings; - - lc.seaLeeches = 0; - if (statsObject.has("kills_sea_leech")) { - lc.seaLeeches = statsObject.get("kills_sea_leech").getAsInt(); - } - lc.seaCreatures += lc.seaLeeches; - - lc.guardianDefenders = 0; - if (statsObject.has("kills_guardian_defender")) { - lc.guardianDefenders = statsObject.get("kills_guardian_defender").getAsInt(); - } - lc.seaCreatures += lc.guardianDefenders; - - lc.deepSeaProtectors = 0; - if (statsObject.has("kills_deep_sea_protector")) { - lc.deepSeaProtectors = statsObject.get("kills_deep_sea_protector").getAsInt(); - } - lc.seaCreatures += lc.deepSeaProtectors; - - lc.hydras = 0; - if (statsObject.has("kills_water_hydra")) { - // Hydra splits - lc.hydras = statsObject.get("kills_water_hydra").getAsInt() / 2; - } - lc.seaCreatures += lc.hydras; - - lc.seaEmperors = 0; - if (statsObject.has("kills_skeleton_emperor")) { - if (statsObject.has("kills_guardian_emperor")) { - lc.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt() + statsObject.get("kills_guardian_emperor").getAsInt(); - } else { - lc.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt(); - } - } else if (statsObject.has("kills_guardian_emperor")) { - lc.seaEmperors = statsObject.get("kills_guardian_emperor").getAsInt(); - } - lc.seaCreatures += lc.seaEmperors; - - lc.fishingMilestone = 0; - if (statsObject.has("pet_milestone_sea_creatures_killed")) { - lc.fishingMilestone = statsObject.get("pet_milestone_sea_creatures_killed").getAsInt(); - } - - lc.frozenSteves = 0; - if (statsObject.has("kills_frozen_steve")) { - lc.frozenSteves = statsObject.get("kills_frozen_steve").getAsInt(); - } - lc.seaCreatures += lc.frozenSteves; - - lc.frostyTheSnowmans = 0; - if (statsObject.has("kills_frosty_the_snowman")) { - lc.frostyTheSnowmans = statsObject.get("kills_frosty_the_snowman").getAsInt(); - } - lc.seaCreatures += lc.frostyTheSnowmans; - - lc.grinches = 0; - if (statsObject.has("kills_grinch")) { - lc.grinches = statsObject.get("kills_grinch").getAsInt(); - } - lc.seaCreatures += lc.grinches; - - lc.yetis = 0; - if (statsObject.has("kills_yeti")) { - lc.yetis = statsObject.get("kills_yeti").getAsInt(); - } - lc.seaCreatures += lc.yetis; - - System.out.println("Writing to config..."); - cf.writeIntConfig("fishing", "goodCatch", lc.goodCatches); - cf.writeIntConfig("fishing", "greatCatch", lc.greatCatches); - cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); - cf.writeIntConfig("fishing", "squid", lc.squids); - cf.writeIntConfig("fishing", "seaWalker", lc.seaWalkers); - cf.writeIntConfig("fishing", "nightSquid", lc.nightSquids); - cf.writeIntConfig("fishing", "seaGuardian", lc.seaGuardians); - cf.writeIntConfig("fishing", "seaWitch", lc.seaWitches); - cf.writeIntConfig("fishing", "seaArcher", lc.seaArchers); - cf.writeIntConfig("fishing", "monsterOfDeep", lc.monsterOfTheDeeps); - cf.writeIntConfig("fishing", "catfish", lc.catfishes); - cf.writeIntConfig("fishing", "carrotKing", lc.carrotKings); - cf.writeIntConfig("fishing", "seaLeech", lc.seaLeeches); - cf.writeIntConfig("fishing", "guardianDefender", lc.guardianDefenders); - cf.writeIntConfig("fishing", "deepSeaProtector", lc.deepSeaProtectors); - cf.writeIntConfig("fishing", "hydra", lc.hydras); - cf.writeIntConfig("fishing", "seaEmperor", lc.seaEmperors); - cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - cf.writeIntConfig("fishing", "frozenSteve", lc.frozenSteves); - cf.writeIntConfig("fishing", "snowman", lc.frostyTheSnowmans); - cf.writeIntConfig("fishing", "grinch", lc.grinches); - cf.writeIntConfig("fishing", "yeti", lc.yetis); - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Fishing stats imported.")); - }).start(); - } - -} diff --git a/me/Danker/commands/LootCommand.java b/me/Danker/commands/LootCommand.java deleted file mode 100644 index d64e9d9..0000000 --- a/me/Danker/commands/LootCommand.java +++ /dev/null @@ -1,533 +0,0 @@ -package me.Danker.commands; - -import java.text.NumberFormat; -import java.util.List; -import java.util.Locale; - -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; - -public class LootCommand extends CommandBase { - // Wolf - public static int wolfSvens; - public static int wolfTeeth; - public static int wolfWheels; - public static int wolfWheelsDrops; - public static int wolfSpirits; - public static int wolfBooks; - public static int wolfEggs; - public static int wolfCoutures; - public static int wolfBaits; - public static int wolfFluxes; - public static double wolfTime; - public static int wolfBosses; - // Spider - public static int spiderTarantulas; - public static int spiderWebs; - public static int spiderTAP; - public static int spiderTAPDrops; - public static int spiderBites; - public static int spiderCatalysts; - public static int spiderBooks; - public static int spiderSwatters; - public static int spiderTalismans; - public static int spiderMosquitos; - public static double spiderTime; - public static int spiderBosses; - // Zombie - public static int zombieRevs; - public static int zombieRevFlesh; - public static int zombieFoulFlesh; - public static int zombieFoulFleshDrops; - public static int zombiePestilences; - public static int zombieUndeadCatas; - public static int zombieBooks; - public static int zombieBeheadeds; - public static int zombieRevCatas; - public static int zombieSnakes; - public static int zombieScythes; - public static double zombieTime; - public static int zombieBosses; - - // Fishing - public static int seaCreatures; - public static int goodCatches; - public static int greatCatches; - public static int squids; - public static int seaWalkers; - public static int nightSquids; - public static int seaGuardians; - public static int seaWitches; - public static int seaArchers; - public static int monsterOfTheDeeps; - public static int catfishes; - public static int carrotKings; - public static int seaLeeches; - public static int guardianDefenders; - public static int deepSeaProtectors; - public static int hydras; - public static int seaEmperors; - public static double empTime; - public static int empSCs; - public static int fishingMilestone; - // Fishing Winter - public static int frozenSteves; - public static int frostyTheSnowmans; - public static int grinches; - public static int yetis; - - // Single sessions (No config saves) - // Wolf - public static int wolfSvensSession = 0; - public static int wolfTeethSession = 0; - public static int wolfWheelsSession = 0; - public static int wolfWheelsDropsSession = 0; - public static int wolfSpiritsSession = 0; - public static int wolfBooksSession = 0; - public static int wolfEggsSession = 0; - public static int wolfCouturesSession = 0; - public static int wolfBaitsSession = 0; - public static int wolfFluxesSession = 0; - public static double wolfTimeSession = -1; - public static int wolfBossesSession = -1; - // Spider - public static int spiderTarantulasSession = 0; - public static int spiderWebsSession = 0; - public static int spiderTAPSession = 0; - public static int spiderTAPDropsSession = 0; - public static int spiderBitesSession = 0; - public static int spiderCatalystsSession = 0; - public static int spiderBooksSession = 0; - public static int spiderSwattersSession = 0; - public static int spiderTalismansSession = 0; - public static int spiderMosquitosSession = 0; - public static double spiderTimeSession = -1; - public static int spiderBossesSession = -1; - // Zombie - public static int zombieRevsSession = 0; - public static int zombieRevFleshSession = 0; - public static int zombieFoulFleshSession = 0; - public static int zombieFoulFleshDropsSession = 0; - public static int zombiePestilencesSession = 0; - public static int zombieUndeadCatasSession = 0; - public static int zombieBooksSession = 0; - public static int zombieBeheadedsSession = 0; - public static int zombieRevCatasSession = 0; - public static int zombieSnakesSession = 0; - public static int zombieScythesSession = 0; - public static double zombieTimeSession = -1; - public static int zombieBossesSession = -1; - - // Fishing - public static int seaCreaturesSession = 0; - public static int goodCatchesSession = 0; - public static int greatCatchesSession = 0; - public static int squidsSession = 0; - public static int seaWalkersSession = 0; - public static int nightSquidsSession = 0; - public static int seaGuardiansSession = 0; - public static int seaWitchesSession = 0; - public static int seaArchersSession = 0; - public static int monsterOfTheDeepsSession = 0; - public static int catfishesSession = 0; - public static int carrotKingsSession = 0; - public static int seaLeechesSession = 0; - public static int guardianDefendersSession = 0; - public static int deepSeaProtectorsSession = 0; - public static int hydrasSession = 0; - public static int seaEmperorsSession = 0; - public static double empTimeSession = -1; - public static int empSCsSession = -1; - public static int fishingMilestoneSession = 0; - // Fishing Winter - public static int frozenStevesSession = 0; - public static int frostyTheSnowmansSession = 0; - public static int grinchesSession = 0; - public static int yetisSession = 0; - - public String getTimeBetween(double timeOne, double timeTwo) { - double secondsBetween = Math.floor(timeTwo - timeOne); - - String timeFormatted = ""; - int days; - int hours; - int minutes; - int seconds; - - if (secondsBetween > 86400) { - // More than 1d, display #d#h - days = (int) (secondsBetween / 86400); - hours = (int) (secondsBetween % 86400 / 3600); - timeFormatted = days + "d" + hours + "h"; - } else if (secondsBetween > 3600) { - // More than 1h, display #h#m - hours = (int) (secondsBetween / 3600); - minutes = (int) (secondsBetween % 3600 / 60); - timeFormatted = hours + "h" + minutes + "m"; - } else { - // Display #m#s - minutes = (int) (secondsBetween / 60); - seconds = (int) (secondsBetween % 60); - timeFormatted = minutes + "m" + seconds + "s"; - } - - return timeFormatted; - } - - @Override - public String getCommandName() { - return "loot"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " [winter/session]"; - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing"); - } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "session"); - } else if (args.length == 2 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { - return getListOfStringsMatchingLastWord(args, "session"); - } - return null; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - final EntityPlayer player = (EntityPlayer) arg0; - - if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [winter/session]")); - return; - } - - double timeNow = System.currentTimeMillis() / 1000; - String timeBetween; - String bossesBetween; - String drop20; - NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); - boolean showSession = false; - - if (arg1.length > 1) { - if (arg1[1].equalsIgnoreCase("session")) { - showSession = true; - } else if (arg1.length > 2) { - if (arg1[2].equalsIgnoreCase("session")) { - showSession = true; - } - } - } - - if (arg1[0].equalsIgnoreCase("wolf")) { - if (showSession) { - if (wolfTimeSession == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(wolfTimeSession, timeNow); - } - if (wolfBossesSession == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(wolfBossesSession); - } - if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(wolfWheelsSession); - } else { - drop20 = nf.format(wolfWheelsDropsSession) + " times"; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(wolfSvensSession) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(wolfTeethSession) + "\n" + - EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + - EnumChatFormatting.AQUA + " Spirit Runes: " + wolfSpiritsSession + "\n" + - EnumChatFormatting.WHITE + " Critical VI Books: " + wolfBooksSession + "\n" + - EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + wolfEggsSession + "\n" + - EnumChatFormatting.GOLD + " Couture Runes: " + wolfCouturesSession + "\n" + - EnumChatFormatting.AQUA + " Grizzly Baits: " + wolfBaitsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + wolfFluxesSession + "\n" + - EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); - return; - } - - if (wolfTime == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(wolfTime, timeNow); - } - if (wolfBosses == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(wolfBosses); - } - if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(wolfWheels); - } else { - drop20 = nf.format(wolfWheelsDrops) + " times"; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary:\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(wolfSvens) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(wolfTeeth) + "\n" + - EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + - EnumChatFormatting.AQUA + " Spirit Runes: " + wolfSpirits + "\n" + - EnumChatFormatting.WHITE + " Critical VI Books: " + wolfBooks + "\n" + - EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + wolfEggs + "\n" + - EnumChatFormatting.GOLD + " Couture Runes: " + wolfCoutures + "\n" + - EnumChatFormatting.AQUA + " Grizzly Baits: " + wolfBaits + "\n" + - EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + wolfFluxes + "\n" + - EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); - } else if (arg1[0].equalsIgnoreCase("spider")) { - if (showSession) { - if (spiderTimeSession == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(spiderTimeSession, timeNow); - } - if (spiderBossesSession == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(spiderBossesSession); - } - if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(spiderTAPSession); - } else { - drop20 = nf.format(spiderTAPDropsSession) + " times"; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(spiderTarantulasSession) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(spiderWebsSession) + "\n" + - EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + " Bite Runes: " + spiderBitesSession + "\n" + - EnumChatFormatting.WHITE + " Bane VI Books: " + spiderBooksSession + "\n" + - EnumChatFormatting.AQUA + " Spider Catalysts: " + spiderCatalystsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + spiderTalismansSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + spiderSwattersSession + "\n" + - EnumChatFormatting.GOLD + " Digested Mosquitos: " + spiderMosquitosSession + "\n" + - EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); - return; - } - - if (spiderTime == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(spiderTime, timeNow); - } - if (spiderBosses == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(spiderBosses); - } - if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(spiderTAP); - } else { - drop20 = nf.format(spiderTAPDrops) + " times"; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary:\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(spiderWebs) + "\n" + - EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + " Bite Runes: " + spiderBites + "\n" + - EnumChatFormatting.WHITE + " Bane VI Books: " + spiderBooks + "\n" + - EnumChatFormatting.AQUA + " Spider Catalysts: " + spiderCatalysts + "\n" + - EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + spiderTalismans + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + spiderSwatters + "\n" + - EnumChatFormatting.GOLD + " Digested Mosquitos: " + spiderMosquitos + "\n" + - EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); - } else if (arg1[0].equalsIgnoreCase("zombie")) { - if (showSession) { - if (zombieTimeSession == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(zombieTimeSession, timeNow); - } - if (zombieBossesSession == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(zombieBossesSession); - } - if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(zombieFoulFleshSession); - } else { - drop20 = nf.format(zombieFoulFleshDropsSession) + " times"; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(zombieRevsSession) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(zombieRevFleshSession) + "\n" + - EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + zombiePestilencesSession + "\n" + - EnumChatFormatting.WHITE + " Smite VI Books: " + zombieBooksSession + "\n" + - EnumChatFormatting.AQUA + " Undead Catalysts: " + zombieUndeadCatasSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + zombieBeheadedsSession + "\n" + - EnumChatFormatting.RED + " Revenant Catalysts: " + zombieRevCatasSession + "\n" + - EnumChatFormatting.DARK_GREEN + " Snake Runes: " + zombieSnakesSession + "\n" + - EnumChatFormatting.GOLD + " Scythe Blades: " + zombieScythesSession + "\n" + - EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); - return; - } - - if (zombieTime == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(zombieTime, timeNow); - } - if (zombieBosses == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(zombieBosses); - } - if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(zombieFoulFlesh); - } else { - drop20 = nf.format(zombieFoulFleshDrops) + " times"; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary:\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(zombieRevs) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(zombieRevFlesh) + "\n" + - EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + zombiePestilences + "\n" + - EnumChatFormatting.WHITE + " Smite VI Books: " + zombieBooks + "\n" + - EnumChatFormatting.AQUA + " Undead Catalysts: " + zombieUndeadCatas + "\n" + - EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + zombieBeheadeds + "\n" + - EnumChatFormatting.RED + " Revenant Catalysts: " + zombieRevCatas + "\n" + - EnumChatFormatting.DARK_GREEN + " Snake Runes: " + zombieSnakes + "\n" + - EnumChatFormatting.GOLD + " Scythe Blades: " + zombieScythes + "\n" + - EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + - EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); - } else if (arg1[0].equalsIgnoreCase("fishing")) { - if (arg1.length > 1) { - if (arg1[1].equalsIgnoreCase("winter")) { - if (showSession) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + " Winter Fishing Summary (Current Session):\n" + - EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(frozenStevesSession) + "\n" + - EnumChatFormatting.WHITE + " Snowmans: " + nf.format(frostyTheSnowmansSession) + "\n" + - EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(grinchesSession) + "\n" + - EnumChatFormatting.GOLD + " Yetis: " + nf.format(yetisSession) + "\n" + - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); - return; - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + " Winter Fishing Summary:\n" + - EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(frozenSteves) + "\n" + - EnumChatFormatting.WHITE + " Snowmans: " + nf.format(frostyTheSnowmans) + "\n" + - EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(grinches) + "\n" + - EnumChatFormatting.GOLD + " Yetis: " + nf.format(yetis) + "\n" + - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); - return; - } - } - - if (showSession) { - if (empTimeSession == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(empTimeSession, timeNow); - } - if (empSCsSession == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(empSCsSession); - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " Fishing Summary (Current Session):\n" + - EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(seaCreaturesSession) + "\n" + - EnumChatFormatting.GOLD + " Good Catches: " + nf.format(goodCatchesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(greatCatchesSession) + "\n\n" + - EnumChatFormatting.GRAY + " Squids: " + nf.format(squidsSession) + "\n" + - EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(seaWalkersSession) + "\n" + - EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(nightSquidsSession) + "\n" + - EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(seaGuardiansSession) + "\n" + - EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(seaWitchesSession) + "\n" + - EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(seaArchersSession) + "\n" + - EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(monsterOfTheDeepsSession) + "\n" + - EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(catfishesSession) + "\n" + - EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(carrotKingsSession) + "\n" + - EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(seaLeechesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(guardianDefendersSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(deepSeaProtectorsSession) + "\n" + - EnumChatFormatting.GOLD + " Hydras: " + nf.format(hydrasSession) + "\n" + - EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(seaEmperorsSession) + "\n" + - EnumChatFormatting.AQUA + " Time Since Sea Emperor: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Sea Creatures Since Sea Emperor: " + bossesBetween + "\n" + - EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " -------------------")); - return; - } - - if (empTime == -1) { - timeBetween = "Never"; - } else { - timeBetween = getTimeBetween(empTime, timeNow); - } - if (empSCs == -1) { - bossesBetween = "Never"; - } else { - bossesBetween = nf.format(empSCs); - } - - player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " Fishing Summary:\n" + - EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(seaCreatures) + "\n" + - EnumChatFormatting.GOLD + " Good Catches: " + nf.format(goodCatches) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(greatCatches) + "\n\n" + - EnumChatFormatting.GRAY + " Squids: " + nf.format(squids) + "\n" + - EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(seaWalkers) + "\n" + - EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(nightSquids) + "\n" + - EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(seaGuardians) + "\n" + - EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(seaWitches) + "\n" + - EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(seaArchers) + "\n" + - EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(monsterOfTheDeeps) + "\n" + - EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(catfishes) + "\n" + - EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(carrotKings) + "\n" + - EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(seaLeeches) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(guardianDefenders) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(deepSeaProtectors) + "\n" + - EnumChatFormatting.GOLD + " Hydras: " + nf.format(hydras) + "\n" + - EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(seaEmperors) + "\n" + - EnumChatFormatting.AQUA + " Time Since Sea Emperor: " + timeBetween + "\n" + - EnumChatFormatting.AQUA + " Sea Creatures Since Sea Emperor: " + bossesBetween + "\n" + - EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " -------------------")); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [winter/session]")); - } - - } - -} diff --git a/me/Danker/commands/MoveCommand.java b/me/Danker/commands/MoveCommand.java deleted file mode 100644 index 1232e18..0000000 --- a/me/Danker/commands/MoveCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -package me.Danker.commands; - -import java.util.List; - -import me.Danker.handlers.ConfigHandler; -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; - -public class MoveCommand extends CommandBase { - - public static int[] coordsXY = {0, 0}; - public static int[] displayXY = {0, 0}; - - @Override - public String getCommandName() { - return "move"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " "; - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display"); - } - return null; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - final EntityPlayer player = (EntityPlayer)arg0; - final ConfigHandler cf = new ConfigHandler(); - - if (arg1.length < 2) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move ")); - return; - } - - if (arg1[0].equalsIgnoreCase("coords")) { - coordsXY[0] = Integer.parseInt(arg1[1]); - coordsXY[1] = Integer.parseInt(arg1[2]); - cf.writeIntConfig("locations", "coordsX", coordsXY[0]); - cf.writeIntConfig("locations", "coordsY", coordsXY[1]); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Coords have been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2])); - } else if (arg1[0].equalsIgnoreCase("display")) { - displayXY[0] = Integer.parseInt(arg1[1]); - displayXY[1] = Integer.parseInt(arg1[2]); - cf.writeIntConfig("locations", "displayX", displayXY[0]); - cf.writeIntConfig("locations", "displayY", displayXY[1]); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Tracker display has been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2])); - } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move ")); - } - } - -} diff --git a/me/Danker/commands/PetsCommand.java b/me/Danker/commands/PetsCommand.java deleted file mode 100644 index 75367ab..0000000 --- a/me/Danker/commands/PetsCommand.java +++ /dev/null @@ -1,247