From 09291c4f8ee992d2b1c037dfeac84ee362e6288e Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sat, 3 Apr 2021 19:59:46 +0200 Subject: added Completed Commission Highlighting --- src/main/java/me/Danker/DankersSkyblockMod.java | 4 ++- .../java/me/Danker/commands/ToggleCommand.java | 11 +++++-- .../me/Danker/features/HighlightCommissions.java | 37 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 12 ++++--- .../java/me/Danker/handlers/ConfigHandler.java | 1 + 5 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 src/main/java/me/Danker/features/HighlightCommissions.java (limited to 'src') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 3aeb452..33c4e86 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -133,6 +133,8 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); + MinecraftForge.EVENT_BUS.register(new HighlightCommissions()); + ConfigHandler.reloadConfig(); GoldenEnchants.init(); TriviaSolver.init(); @@ -380,7 +382,7 @@ public class DankersSkyblockMod { @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { - if (!Utils.inSkyblock) return; + //if (!Utils.inSkyblock) return; if (event.gui instanceof GuiChest) { GuiChest inventory = (GuiChest) event.gui; Container containerChest = inventory.inventorySlots; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index a6f20fc..b9c52e7 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -33,6 +33,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cakeTimerToggled; public static boolean highlightSlayers; public static boolean highlightArachne; + public static boolean highlightCommissions; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -76,7 +77,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean bloodRoomMusic; public static boolean dungeonMusic; - @Override + @Override public String getCommandName() { return "toggle"; } @@ -93,7 +94,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + - "dungeonmusic/list>"; + "dungeonmusic/highlightcommissions/list>"; } public static String usage(ICommandSender arg0) { @@ -121,7 +122,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", - "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); + "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "highlightcommissions", "list"); } return null; } @@ -396,6 +397,10 @@ public class ToggleCommand extends CommandBase implements ICommand { highlightArachne = !highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + 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 + ".")); case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java new file mode 100644 index 0000000..ae262c3 --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -0,0 +1,37 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.item.ItemWritableBook; + +import org.lwjgl.util.Color; +import java.util.List; + +public class HighlightCommissions { + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + if(!Utils.inSkyblock) return; + if(!ToggleCommand.highlightCommissions) return; + List slots = event.slots; + if (!event.displayName.equals("Commissions")) return; + + for (Slot slot : slots) { + if (slot != null && slot.getStack() == null) continue; + if (slot.getStack().getItem() instanceof ItemWritableBook) { + for (String line : Utils.getItemLore(slot.getStack())) { + if (line.contains("COMPLETED")) { + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0x51FF51 + 0xD7000000); + break; + } + } + + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 569f4d1..22cc001 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -6,10 +6,7 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.*; import net.minecraft.util.StringUtils; import java.awt.*; @@ -60,6 +57,7 @@ public class DankerGui extends GuiScreen { private GuiButton autoSkillTracker; private GuiButton highlightArachne; private GuiButton highlightSlayer; + private GuiButton highlightCommissions; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -143,6 +141,7 @@ public class DankerGui extends GuiScreen { melodyTooltips = new GuiButton(0, 0, 0, "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); highlightArachne = new GuiButton(0, 0, 0, "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); highlightSlayer = new GuiButton(0, 0, 0, "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); + highlightCommissions = new GuiButton(0, 0, 0, "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions)); allButtons.add(changeDisplay); allButtons.add(puzzleSolvers); @@ -183,6 +182,7 @@ public class DankerGui extends GuiScreen { allButtons.add(melodyTooltips); allButtons.add(highlightArachne); allButtons.add(highlightSlayer); + allButtons.add(highlightCommissions); search.setText(initSearchText); search.setVisible(true); @@ -402,6 +402,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); highlightSlayer.displayString = "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); + } else if (button == highlightCommissions) { + ToggleCommand.highlightCommissions = !ToggleCommand.highlightCommissions; + ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", ToggleCommand.highlightCommissions); + highlightCommissions.displayString = "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index d3b7464..0fe7245 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -228,6 +228,7 @@ public class ConfigHandler { ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); + ToggleCommand.highlightCommissions = initBoolean("toggles", "HighlightCommissions", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From d085f3fe3a18261785d93150fd99fac5ed312e69 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 13 Apr 2021 12:59:58 +0200 Subject: added warping commands for every mvp+ exclusive location --- src/main/java/me/Danker/DankersSkyblockMod.java | 11 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 - .../java/me/Danker/commands/DungeonsCommand.java | 152 --------------------- src/main/java/me/Danker/commands/warp/Crypt.java | 47 +++++++ .../java/me/Danker/commands/warp/DarkAuction.java | 48 +++++++ src/main/java/me/Danker/commands/warp/Dragon.java | 48 +++++++ .../java/me/Danker/commands/warp/DungeonHub.java | 48 +++++++ .../java/me/Danker/commands/warp/HowlingCave.java | 47 +++++++ src/main/java/me/Danker/commands/warp/Magma.java | 47 +++++++ .../java/me/Danker/commands/warp/SpidersNest.java | 47 +++++++ 10 files changed, 342 insertions(+), 154 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/DungeonsCommand.java create mode 100644 src/main/java/me/Danker/commands/warp/Crypt.java create mode 100644 src/main/java/me/Danker/commands/warp/DarkAuction.java create mode 100644 src/main/java/me/Danker/commands/warp/Dragon.java create mode 100644 src/main/java/me/Danker/commands/warp/DungeonHub.java create mode 100644 src/main/java/me/Danker/commands/warp/HowlingCave.java create mode 100644 src/main/java/me/Danker/commands/warp/Magma.java create mode 100644 src/main/java/me/Danker/commands/warp/SpidersNest.java (limited to 'src') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index deb5c3b..619b6e6 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,6 +1,7 @@ package me.Danker; import me.Danker.commands.*; +import me.Danker.commands.warp.*; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.events.RenderOverlay; @@ -157,7 +158,6 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new DHelpCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); ClientCommandHandler.instance.registerCommand(new DisplayCommand()); - ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); ClientCommandHandler.instance.registerCommand(new FairySoulsCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); @@ -177,6 +177,15 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); + + ClientCommandHandler.instance.registerCommand(new Crypt()); + ClientCommandHandler.instance.registerCommand(new DarkAuction()); + ClientCommandHandler.instance.registerCommand(new Dragon()); + ClientCommandHandler.instance.registerCommand(new DungeonHub()); + ClientCommandHandler.instance.registerCommand(new HowlingCave()); + ClientCommandHandler.instance.registerCommand(new Magma()); + ClientCommandHandler.instance.registerCommand(new SpidersNest()); + configDirectory = event.getModConfigurationDirectory().toString(); } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 8d47576..c405d22 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -49,7 +49,6 @@ 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 + DungeonsCommand.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" + diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java deleted file mode 100644 index 92779dc..0000000 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ /dev/null @@ -1,152 +0,0 @@ -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.event.HoverEvent; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -import java.util.List; - -public class DungeonsCommand extends CommandBase { - - @Override - public String getCommandName() { - return "dungeons"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [name]"; - } - - public static String usage(ICommandSender arg0) { - return new DungeonsCommand().getCommandUsage(arg0); - } - - @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(() -> { - 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.")); - } - - // 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 dungeon stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); - } else { - username = arg1[0]; - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking dungeon 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; - } - - String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; - System.out.println("Fetching player data..."); - JsonObject playerResponse = APIHandler.getResponse(playerURL); - if(!playerResponse.get("success").getAsBoolean()){ - String reason = playerResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); - } - - 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(DankersSkyblockMod.ERROR_COLOUR + "This player has not played dungeons.")); - return; - } - - JsonObject catacombsObject = dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject(); - double catacombs = Utils.xpToDungeonsLevel(catacombsObject.get("experience").getAsDouble()); - double healer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()); - double mage = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("mage").getAsJsonObject().get("experience").getAsDouble()); - double berserk = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("berserk").getAsJsonObject().get("experience").getAsDouble()); - double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); - 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()); - int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); - - int highestFloor = catacombsObject.get("highest_tier_completed").getAsInt(); - JsonObject completionObj = catacombsObject.get("tier_completions").getAsJsonObject(); - - String delimiter = DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------"; - - ChatComponentText classLevels = new ChatComponentText( - EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + - EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + - EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + - EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + - EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + - EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + - EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); - - StringBuilder completionsHoverString = new StringBuilder(); - - for (int i = 0; i <= highestFloor; i++) { - completionsHoverString - .append(EnumChatFormatting.GOLD) - .append(i == 0 ? "Entrance: " : "Floor " + i + ": ") - .append(EnumChatFormatting.RESET) - .append(completionObj.get(String.valueOf(i)).getAsInt()) - .append(i < highestFloor ? "\n": ""); - } - - ChatComponentText completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: " + highestFloor); - - completions.setChatStyle(completions.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(completionsHoverString.toString())))); - - - player.addChatMessage( - new ChatComponentText(delimiter) - .appendText("\n") - .appendSibling(classLevels) - .appendSibling(completions) - .appendText("\n") - .appendSibling(new ChatComponentText(delimiter)) - ); - }).start(); - } -} diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java new file mode 100644 index 0000000..88f286b --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/Crypt.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class Crypt extends CommandBase { + @Override + public String getCommandName() { + return "crypt"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.Crypt().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java new file mode 100644 index 0000000..40218d8 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/DarkAuction.java @@ -0,0 +1,48 @@ +package me.Danker.commands.warp; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class DarkAuction extends CommandBase { + @Override + public String getCommandName() { + return "da"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java new file mode 100644 index 0000000..f36bef1 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/Dragon.java @@ -0,0 +1,48 @@ +package me.Danker.commands.warp; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class Dragon extends CommandBase { + @Override + public String getCommandName() { + return "drag"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java new file mode 100644 index 0000000..cc1c082 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/DungeonHub.java @@ -0,0 +1,48 @@ +package me.Danker.commands.warp; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class DungeonHub extends CommandBase { + @Override + public String getCommandName() { + return "dun"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.DungeonHub().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java new file mode 100644 index 0000000..4cdcf97 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/HowlingCave.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class HowlingCave extends CommandBase { + @Override + public String getCommandName() { + return "howl"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.HowlingCave().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java new file mode 100644 index 0000000..96ead00 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/Magma.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class Magma extends CommandBase { + @Override + public String getCommandName() { + return "magma"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.Magma().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java new file mode 100644 index 0000000..2f091ad --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/SpidersNest.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +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 java.util.List; + +public class SpidersNest extends CommandBase { + @Override + public String getCommandName() { + return "nest"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.SpidersNest().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); + }).start(); + } +} -- cgit From 5b64838ea3f8b5c0de84700e540163a6c0a4eb70 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 13 Apr 2021 13:12:55 +0200 Subject: added the changes to the readme and dhelpcommand --- README.md | 10 ++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'src') diff --git a/README.md b/README.md index 1faef53..84b6e5f 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,16 @@ Discord Server: https://discord.gg/QsEkNQS - /lobbybank - 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). - /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. +##Warps +Commands for to warp to the MVP+ exclusive warps +- /crypt - Warps you to the Crypt in the Hub. +- /da - Warps you to the Dark Auction in the Hub. +- /drag - Warps you to the Dragons Nest in the End. +- /dun - Warps you to the Dungeon Hub. +- /howl - Warps you to the Howling Cave in the Park. +- /magma - Warps you to the Magma Fields in the Blazing Fortress. +- /nest - Warps you to the Top of the Spider's Nest in the Spider's Den. + ## Keybinds - Open Maddox menu - M by default. - Regular Ability - Numpad 4 by default. diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index c405d22..d5f3617 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -1,6 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import me.Danker.commands.warp.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -55,6 +56,13 @@ public class DHelpCommand extends CommandBase { 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 + 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" + + EnumChatFormatting.GOLD + DungeonHub.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dungeon Hub. \n" + + EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + + EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + + EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } -- cgit From c673d8bd0d9857ca0f04782d903208c5f8ec23d0 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 20 Apr 2021 12:17:07 +0200 Subject: fixed kill combo messages still displaying when above 50 --- src/main/java/me/Danker/features/SpamHider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/me/Danker/features/SpamHider.java b/src/main/java/me/Danker/features/SpamHider.java index a88d9e5..f1a40c9 100644 --- a/src/main/java/me/Danker/features/SpamHider.java +++ b/src/main/java/me/Danker/features/SpamHider.java @@ -49,7 +49,7 @@ public class SpamHider { } // Kill Combo if (!ToggleCommand.killComboMessages) { - if ((message.contains("+") && message.contains(" Kill Combo ")) || message.contains("Your Kill Combo has expired!")) { + if ((message.contains("+") && message.contains(" Kill Combo")) || message.contains("Your Kill Combo has expired!")) { event.setCanceled(true); } } -- cgit From 06565f0136aebc720b24d0c1b1b79c9043ed01bf Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Wed, 28 Apr 2021 12:48:15 +0200 Subject: added a command to set your yaw and pitch --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/SetAngleCommand.java | 40 ++++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/Danker/commands/SetAngleCommand.java (limited to 'src') diff --git a/README.md b/README.md index 84b6e5f..2ab9fe0 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Discord Server: https://discord.gg/QsEkNQS - /fairysouls - Check the fairysouls of a player - /lobbybank - 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). - /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. +- /setangle [yaw] [pitch] - Sets your yaw and pitch ##Warps Commands for to warp to the MVP+ exclusive warps diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 619b6e6..fe5d7ac 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -176,7 +176,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); - + ClientCommandHandler.instance.registerCommand(new SetAngleCommand()); ClientCommandHandler.instance.registerCommand(new Crypt()); ClientCommandHandler.instance.registerCommand(new DarkAuction()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index d5f3617..207e700 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -63,6 +63,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + + EnumChatFormatting.GOLD + SetAngleCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets your yaw and pitch. \n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/SetAngleCommand.java b/src/main/java/me/Danker/commands/SetAngleCommand.java new file mode 100644 index 0000000..3b288c4 --- /dev/null +++ b/src/main/java/me/Danker/commands/SetAngleCommand.java @@ -0,0 +1,40 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + + +public class SetAngleCommand extends CommandBase { + + @Override + public String getCommandName() { + return "setangle"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName() + " [yaw] [pitch]"; + } + + public static String usage(ICommandSender arg0) { + return new SetAngleCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length < 2) return; + + Minecraft.getMinecraft().thePlayer.rotationPitch = Float.parseFloat(args[1]); + Minecraft.getMinecraft().thePlayer.rotationYaw = Float.parseFloat(args[0]); + sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to y=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", x=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); + } +} -- cgit From 09622e51e46d6772e9017bfa9bb544616ebba8b7 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Wed, 28 Apr 2021 12:55:17 +0200 Subject: typo --- src/main/java/me/Danker/commands/SetAngleCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/me/Danker/commands/SetAngleCommand.java b/src/main/java/me/Danker/commands/SetAngleCommand.java index 3b288c4..6061621 100644 --- a/src/main/java/me/Danker/commands/SetAngleCommand.java +++ b/src/main/java/me/Danker/commands/SetAngleCommand.java @@ -35,6 +35,6 @@ public class SetAngleCommand extends CommandBase { Minecraft.getMinecraft().thePlayer.rotationPitch = Float.parseFloat(args[1]); Minecraft.getMinecraft().thePlayer.rotationYaw = Float.parseFloat(args[0]); - sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to y=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", x=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); + sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to yaw=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", pitch=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); } } -- cgit From dda757a8520d507cb0585408a68ad5bc216e6625 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Mon, 10 May 2021 19:07:28 +0200 Subject: implemented the changes requested by Danker --- .../java/me/Danker/commands/DungeonsCommand.java | 152 +++++++++++++++++++++ src/main/java/me/Danker/commands/warp/Crypt.java | 5 +- .../java/me/Danker/commands/warp/DarkAuction.java | 5 +- src/main/java/me/Danker/commands/warp/Dragon.java | 5 +- .../java/me/Danker/commands/warp/DungeonHub.java | 5 +- .../java/me/Danker/commands/warp/HowlingCave.java | 5 +- src/main/java/me/Danker/commands/warp/Magma.java | 5 +- .../java/me/Danker/commands/warp/SpidersNest.java | 5 +- .../me/Danker/features/HighlightCommissions.java | 4 +- .../java/me/Danker/handlers/ConfigHandler.java | 1 + 10 files changed, 163 insertions(+), 29 deletions(-) create mode 100644 src/main/java/me/Danker/commands/DungeonsCommand.java (limited to 'src') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java new file mode 100644 index 0000000..9924a9d --- /dev/null +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -0,0 +1,152 @@ +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.event.HoverEvent; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.List; + +public class DungeonsCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dungeons"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new DungeonsCommand().getCommandUsage(arg0); + } + + @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(() -> { + 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.")); + } + + // 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 dungeon stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking dungeon 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; + } + + String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; + System.out.println("Fetching player data..."); + JsonObject playerResponse = APIHandler.getResponse(playerURL); + if(!playerResponse.get("success").getAsBoolean()){ + String reason = playerResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); + } + + 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(DankersSkyblockMod.ERROR_COLOUR + "This player has not played dungeons.")); + return; + } + + JsonObject catacombsObject = dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject(); + double catacombs = Utils.xpToDungeonsLevel(catacombsObject.get("experience").getAsDouble()); + double healer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()); + double mage = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("mage").getAsJsonObject().get("experience").getAsDouble()); + double berserk = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("berserk").getAsJsonObject().get("experience").getAsDouble()); + double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); + 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()); + int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); + + int highestFloor = catacombsObject.get("highest_tier_completed").getAsInt(); + JsonObject completionObj = catacombsObject.get("tier_completions").getAsJsonObject(); + + String delimiter = DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------"; + + ChatComponentText classLevels = new ChatComponentText( + EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + + EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + + EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + + EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + + EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); + + StringBuilder completionsHoverString = new StringBuilder(); + + for (int i = 0; i <= highestFloor; i++) { + completionsHoverString + .append(EnumChatFormatting.GOLD) + .append(i == 0 ? "Entrance: " : "Floor " + i + ": ") + .append(EnumChatFormatting.RESET) + .append(completionObj.get(String.valueOf(i)).getAsInt()) + .append(i < highestFloor ? "\n": ""); + } + + ChatComponentText completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: " + highestFloor); + + completions.setChatStyle(completions.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(completionsHoverString.toString())))); + + + player.addChatMessage( + new ChatComponentText(delimiter) + .appendText("\n") + .appendSibling(classLevels) + .appendSibling(completions) + .appendText("\n") + .appendSibling(new ChatComponentText(delimiter)) + ); + }).start(); + } +} \ No newline at end of file diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java index 88f286b..463330a 100644 --- a/src/main/java/me/Danker/commands/warp/Crypt.java +++ b/src/main/java/me/Danker/commands/warp/Crypt.java @@ -39,9 +39,6 @@ public class Crypt extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); } } diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java index 40218d8..88655f1 100644 --- a/src/main/java/me/Danker/commands/warp/DarkAuction.java +++ b/src/main/java/me/Danker/commands/warp/DarkAuction.java @@ -40,9 +40,6 @@ public class DarkAuction extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); } } diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java index f36bef1..05be968 100644 --- a/src/main/java/me/Danker/commands/warp/Dragon.java +++ b/src/main/java/me/Danker/commands/warp/Dragon.java @@ -40,9 +40,6 @@ public class Dragon extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); } } diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java index cc1c082..201e764 100644 --- a/src/main/java/me/Danker/commands/warp/DungeonHub.java +++ b/src/main/java/me/Danker/commands/warp/DungeonHub.java @@ -40,9 +40,6 @@ public class DungeonHub extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); } } diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java index 4cdcf97..58e4ce7 100644 --- a/src/main/java/me/Danker/commands/warp/HowlingCave.java +++ b/src/main/java/me/Danker/commands/warp/HowlingCave.java @@ -39,9 +39,6 @@ public class HowlingCave extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); } } diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java index 96ead00..5e747c3 100644 --- a/src/main/java/me/Danker/commands/warp/Magma.java +++ b/src/main/java/me/Danker/commands/warp/Magma.java @@ -39,9 +39,6 @@ public class Magma extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); } } diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java index 2f091ad..cf80df8 100644 --- a/src/main/java/me/Danker/commands/warp/SpidersNest.java +++ b/src/main/java/me/Danker/commands/warp/SpidersNest.java @@ -39,9 +39,6 @@ public class SpidersNest extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); } } diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java index ae262c3..f59951a 100644 --- a/src/main/java/me/Danker/features/HighlightCommissions.java +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -13,6 +13,8 @@ import java.util.List; public class HighlightCommissions { + public static int HIGHLIGHT_COLOUR; + @SubscribeEvent public void onGuiRender(GuiChestBackgroundDrawnEvent event) { if(!Utils.inSkyblock) return; @@ -25,7 +27,7 @@ public class HighlightCommissions { if (slot.getStack().getItem() instanceof ItemWritableBook) { for (String line : Utils.getItemLore(slot.getStack())) { if (line.contains("COMPLETED")) { - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0x51FF51 + 0xD7000000); + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, HIGHLIGHT_COLOUR + 0xD7000000); break; } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index ecd15f3..ce0df16 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -525,6 +525,7 @@ public class ConfigHandler { BoulderSolver.BOULDER_ARROW_COLOUR = initInt("colors", "boulderArrow", 0x006000); SilverfishSolver.SILVERFISH_LINE_COLOUR = initInt("colors", "silverfishLine", 0x40FF40); IceWalkSolver.ICE_WALK_LINE_COLOUR = initInt("colors", "iceWalkLine", 0x40FF40); + HighlightCommissions.HIGHLIGHT_COLOUR = initInt("colors", "highlight_colour", 0x51FF51); // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); -- cgit From c8aff00703e459542c9e10d0d208bb40fed47c22 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Mon, 10 May 2021 19:10:30 +0200 Subject: uncommented the Skyblock check --- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index fe31d96..f7f488c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -404,7 +404,7 @@ public class DankersSkyblockMod { @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { - //if (!Utils.inSkyblock) return; + if (!Utils.inSkyblock) return; if (event.gui instanceof GuiChest) { GuiChest inventory = (GuiChest) event.gui; Container containerChest = inventory.inventorySlots; -- cgit From fb830a18c63b00f96ac0fe0aa29099dfe308aa67 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 11 May 2021 16:17:12 +0200 Subject: removed unnecessary player --- src/main/java/me/Danker/commands/warp/Crypt.java | 1 - src/main/java/me/Danker/commands/warp/DarkAuction.java | 1 - src/main/java/me/Danker/commands/warp/Dragon.java | 1 - src/main/java/me/Danker/commands/warp/DungeonHub.java | 1 - src/main/java/me/Danker/commands/warp/HowlingCave.java | 1 - src/main/java/me/Danker/commands/warp/Magma.java | 1 - src/main/java/me/Danker/commands/warp/SpidersNest.java | 1 - 7 files changed, 7 deletions(-) (limited to 'src') diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java index 463330a..fd91790 100644 --- a/src/main/java/me/Danker/commands/warp/Crypt.java +++ b/src/main/java/me/Danker/commands/warp/Crypt.java @@ -38,7 +38,6 @@ public class Crypt extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); } } diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java index 88655f1..d2cffe9 100644 --- a/src/main/java/me/Danker/commands/warp/DarkAuction.java +++ b/src/main/java/me/Danker/commands/warp/DarkAuction.java @@ -39,7 +39,6 @@ public class DarkAuction extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); } } diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java index 05be968..a0cf9ab 100644 --- a/src/main/java/me/Danker/commands/warp/Dragon.java +++ b/src/main/java/me/Danker/commands/warp/Dragon.java @@ -39,7 +39,6 @@ public class Dragon extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); } } diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java index 201e764..3031fec 100644 --- a/src/main/java/me/Danker/commands/warp/DungeonHub.java +++ b/src/main/java/me/Danker/commands/warp/DungeonHub.java @@ -39,7 +39,6 @@ public class DungeonHub extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); } } diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java index 58e4ce7..1d45ada 100644 --- a/src/main/java/me/Danker/commands/warp/HowlingCave.java +++ b/src/main/java/me/Danker/commands/warp/HowlingCave.java @@ -38,7 +38,6 @@ public class HowlingCave extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); } } diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java index 5e747c3..4f7459d 100644 --- a/src/main/java/me/Danker/commands/warp/Magma.java +++ b/src/main/java/me/Danker/commands/warp/Magma.java @@ -38,7 +38,6 @@ public class Magma extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); } } diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java index cf80df8..ecea275 100644 --- a/src/main/java/me/Danker/commands/warp/SpidersNest.java +++ b/src/main/java/me/Danker/commands/warp/SpidersNest.java @@ -38,7 +38,6 @@ public class SpidersNest extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); } } -- cgit From b1c294e151361f11c4449656a3400cff65e7edf7 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sat, 15 May 2021 15:42:48 +0200 Subject: fine i removed it --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 - .../java/me/Danker/commands/SetAngleCommand.java | 40 ---------------------- 2 files changed, 41 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/SetAngleCommand.java (limited to 'src') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index f7f488c..d26736b 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -189,7 +189,6 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); - ClientCommandHandler.instance.registerCommand(new SetAngleCommand()); ClientCommandHandler.instance.registerCommand(new Crypt()); ClientCommandHandler.instance.registerCommand(new DarkAuction()); diff --git a/src/main/java/me/Danker/commands/SetAngleCommand.java b/src/main/java/me/Danker/commands/SetAngleCommand.java deleted file mode 100644 index 6061621..0000000 --- a/src/main/java/me/Danker/commands/SetAngleCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.Danker.commands; - -import me.Danker.DankersSkyblockMod; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; - - -public class SetAngleCommand extends CommandBase { - - @Override - public String getCommandName() { - return "setangle"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName() + " [yaw] [pitch]"; - } - - public static String usage(ICommandSender arg0) { - return new SetAngleCommand().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (args.length < 2) return; - - Minecraft.getMinecraft().thePlayer.rotationPitch = Float.parseFloat(args[1]); - Minecraft.getMinecraft().thePlayer.rotationYaw = Float.parseFloat(args[0]); - sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to yaw=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", pitch=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); - } -} -- cgit From b443b1840760300d6a58951829911025b57f1bfb Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Mon, 17 May 2021 15:24:34 +0200 Subject: fixed a bug --- src/main/java/me/Danker/commands/DHelpCommand.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index f12d0ee..efbf52d 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -65,7 +65,6 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + - EnumChatFormatting.GOLD + SetAngleCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets your yaw and pitch. \n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } -- cgit From eb034080964b408ad6140c6782075500fd8397e9 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 22 Apr 2022 22:28:21 +0200 Subject: removed old warp commands --- src/main/java/me/Danker/commands/DHelpCommand.java | 8 ---- src/main/java/me/Danker/commands/warp/Crypt.java | 43 --------------------- .../java/me/Danker/commands/warp/DarkAuction.java | 44 ---------------------- src/main/java/me/Danker/commands/warp/Dragon.java | 44 ---------------------- .../java/me/Danker/commands/warp/DungeonHub.java | 44 ---------------------- .../java/me/Danker/commands/warp/HowlingCave.java | 43 --------------------- src/main/java/me/Danker/commands/warp/Magma.java | 43 --------------------- .../java/me/Danker/commands/warp/SpidersNest.java | 43 --------------------- 8 files changed, 312 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/warp/Crypt.java delete mode 100644 src/main/java/me/Danker/commands/warp/DarkAuction.java delete mode 100644 src/main/java/me/Danker/commands/warp/Dragon.java delete mode 100644 src/main/java/me/Danker/commands/warp/DungeonHub.java delete mode 100644 src/main/java/me/Danker/commands/warp/HowlingCave.java delete mode 100644 src/main/java/me/Danker/commands/warp/Magma.java delete mode 100644 src/main/java/me/Danker/commands/warp/SpidersNest.java (limited to 'src') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index db474c7..477d43b 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -1,7 +1,6 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; -import me.Danker.commands.warp.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -60,13 +59,6 @@ public class DHelpCommand extends CommandBase { 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" + - EnumChatFormatting.GOLD + DungeonHub.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dungeon Hub. \n" + - EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + - EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + - EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + EnumChatFormatting.GOLD + ReloadConfigCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod config.\n" + EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + EnumChatFormatting.GOLD + FarmLengthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets coords to be used for end of farm alert.\n" + diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java deleted file mode 100644 index fd91790..0000000 --- a/src/main/java/me/Danker/commands/warp/Crypt.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class Crypt extends CommandBase { - @Override - public String getCommandName() { - return "crypt"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.Crypt().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java deleted file mode 100644 index d2cffe9..0000000 --- a/src/main/java/me/Danker/commands/warp/DarkAuction.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.DankersSkyblockMod; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class DarkAuction extends CommandBase { - @Override - public String getCommandName() { - return "da"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java deleted file mode 100644 index a0cf9ab..0000000 --- a/src/main/java/me/Danker/commands/warp/Dragon.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.DankersSkyblockMod; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class Dragon extends CommandBase { - @Override - public String getCommandName() { - return "drag"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java deleted file mode 100644 index 3031fec..0000000 --- a/src/main/java/me/Danker/commands/warp/DungeonHub.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.DankersSkyblockMod; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class DungeonHub extends CommandBase { - @Override - public String getCommandName() { - return "dun"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.DungeonHub().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java deleted file mode 100644 index 1d45ada..0000000 --- a/src/main/java/me/Danker/commands/warp/HowlingCave.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class HowlingCave extends CommandBase { - @Override - public String getCommandName() { - return "howl"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.HowlingCave().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java deleted file mode 100644 index 4f7459d..0000000 --- a/src/main/java/me/Danker/commands/warp/Magma.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class Magma extends CommandBase { - @Override - public String getCommandName() { - return "magma"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.Magma().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java deleted file mode 100644 index ecea275..0000000 --- a/src/main/java/me/Danker/commands/warp/SpidersNest.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -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 java.util.List; - -public class SpidersNest extends CommandBase { - @Override - public String getCommandName() { - return "nest"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.SpidersNest().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); - } -} -- cgit From 4b49b2c392d3acec1d2503edb29b510dd2a214cc Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 22 Apr 2022 22:28:44 +0200 Subject: added new way of registering WarpCommands --- README.md | 36 ++++++--- src/main/java/me/Danker/DankersSkyblockMod.java | 11 +-- .../java/me/Danker/commands/warp/WarpCommand.java | 79 ++++++++++++++++++ .../Danker/commands/warp/WarpCommandHandler.java | 94 ++++++++++++++++++++++ 4 files changed, 203 insertions(+), 17 deletions(-) create mode 100644 src/main/java/me/Danker/commands/warp/WarpCommand.java create mode 100644 src/main/java/me/Danker/commands/warp/WarpCommandHandler.java (limited to 'src') diff --git a/README.md b/README.md index 6cd98e3..e46f75d 100644 --- a/README.md +++ b/README.md @@ -101,16 +101,34 @@ Discord Server: https://discord.gg/QsEkNQS - /dsmfarmlength - Sets coords to be used for end of farm alert. - /hotmof [player] - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours. -##Warps -Commands for to warp to the MVP+ exclusive warps -- /crypt - Warps you to the Crypt in the Hub. -- /da - Warps you to the Dark Auction in the Hub. -- /drag - Warps you to the Dragons Nest in the End. -- /dun - Warps you to the Dungeon Hub. -- /howl - Warps you to the Howling Cave in the Park. -- /magma - Warps you to the Magma Fields in the Blazing Fortress. -- /nest - Warps you to the Top of the Spider's Nest in the Spider's Den. +
+ Warps +### Warps +Shortcut commands that save you the time of typing the whole warp command. + - /deep - Warps you to the Deep Caverns. + - /nether - Warps you to the Crimson Isle. + - /isle - Warps you to the Crimson Isle. + - /crimson - Warps you to the Crimson Isle. + - /mines - Warps you to the Dwarven Mines. + - /forge - Warps you to the Dwarven Forge. + - /crystals - Warps you to the Crystal Hollows. + - /gold - Warps you to the Gold Mine. + - /desert - Warps you to the Desert. + - /spider - Warps you to the Spiders Den. + - /barn - Warps you to the Barn. + - /end - Warps you to the End. + - /park - Warps you to the Park. + - /castle - Warps you to the Hub Castle. + - /da - Warps you to the Dark Auction. + - /crypt - Warps you to the Crypt in the Hub. + - /nest - Warps you to the top of the Spider's Den. + - /void - Warps you to the Void Sepulture in the End. + - /drag - Warps you to the Dragons Nest in the End. + - /jungle - Warps you to the Jungle. + - /howl - Warps you to the Howling Cave in the Park. + - /dun - Warps you to the Dungeon Hub. +
## Keybinds - Open Maddox menu - M by default. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 6fa1995..16c73c8 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2,7 +2,7 @@ package me.Danker; import com.google.gson.JsonObject; import me.Danker.commands.*; -import me.Danker.commands.warp.*; +import me.Danker.commands.warp.WarpCommandHandler; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.events.RenderOverlayEvent; @@ -79,6 +79,7 @@ public class DankersSkyblockMod { public static boolean firstLaunch = false; public static String configDirectory; public static JsonObject data = null; + public static WarpCommandHandler warpCommandHandler; public static int farmingLevel; public static int miningLevel; @@ -232,13 +233,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new ToggleCommand()); ClientCommandHandler.instance.registerCommand(new WeightCommand()); - ClientCommandHandler.instance.registerCommand(new Crypt()); - ClientCommandHandler.instance.registerCommand(new DarkAuction()); - ClientCommandHandler.instance.registerCommand(new Dragon()); - ClientCommandHandler.instance.registerCommand(new DungeonHub()); - ClientCommandHandler.instance.registerCommand(new HowlingCave()); - ClientCommandHandler.instance.registerCommand(new Magma()); - ClientCommandHandler.instance.registerCommand(new SpidersNest()); + warpCommandHandler = new WarpCommandHandler(); configDirectory = event.getModConfigurationDirectory().toString(); } diff --git a/src/main/java/me/Danker/commands/warp/WarpCommand.java b/src/main/java/me/Danker/commands/warp/WarpCommand.java new file mode 100644 index 0000000..730e7cd --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/WarpCommand.java @@ -0,0 +1,79 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; + +public class WarpCommand extends CommandBase { + + + private boolean custom_command = false; + public String name; + public String destination; + + /** + * A Command blueprint extending CommandBase that uses the name and sends the destination as "/warp {@link #destination}" + * @param name the name that the command is called as + * @param destination the location name that is sent + */ + public WarpCommand(String name, String destination) { + this.name = name; + this.destination = destination; + } + + /** + * A Command blueprint extending CommandBase that uses the name and sends the destination as "/warp {@link #destination}" + * @param name the name that the command is called as + * @param destination the location name that is sent + * @param custom_command is the custom command should use the /warp format or send a custom command. + * Adds the "/" to the destination. + */ + public WarpCommand(String name, String destination, boolean custom_command) { + this.name = name; + this.destination = destination; + this.custom_command = custom_command; + } + + /** + * Returns the commands name that is set in the constructor + */ + @Override + public String getCommandName() { + return name; + } + + /** + * Returns the command usage for the builtin help + * @param sender the command sender + * @return "/" + the command name + */ + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + /** + * The logic that is called when the command is executed + * Sends a message as the player containing "/warp {@link #destination}" + * @param sender the command sender + * @param args what is written after the command + */ + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + if (custom_command) { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/" + this.destination); + return; + } + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp " + this.destination); + + } + +} diff --git a/src/main/java/me/Danker/commands/warp/WarpCommandHandler.java b/src/main/java/me/Danker/commands/warp/WarpCommandHandler.java new file mode 100644 index 0000000..6cdf840 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/WarpCommandHandler.java @@ -0,0 +1,94 @@ +package me.Danker.commands.warp; + +import net.minecraftforge.client.ClientCommandHandler; + +import java.util.ArrayList; +import java.util.List; + +public class WarpCommandHandler { + + private List commands; + + /** + * Constructor of the WarpCommandHandler, it will register all commands when it is created + */ + public WarpCommandHandler() { + this.commands = new ArrayList(); + registerCommands(); + } + + + /** + * @return List of all registered commands + */ + public List getCommands() { + return this.commands; + } + + /** + * Registers a command to the handler + * @param warpCommand WarpCommand to register + */ + public void registerCommand(WarpCommand warpCommand) { + this.commands.add(warpCommand); + ClientCommandHandler.instance.registerCommand(warpCommand); + } + + /** + * Get a command by its name + * @param name Name of the command + * @return WarpCommand with the given name + */ + public WarpCommand getCommand(String name) { + for (WarpCommand command : this.commands) { + if (command.getCommandName().equalsIgnoreCase(name)) { + return command; + } + } + return null; + } + + /** + * Get a command by the class it extends from + * @param clazz Class to get the command from + * @return WarpCommand with the given class + */ + public WarpCommand getCommand(Class clazz) { + for (WarpCommand command : this.commands) { + if (command.getClass() == clazz) { + return command; + } + } + return null; + } + + /** + * Register all commands + */ + private void registerCommands() { + registerCommand(new WarpCommand("deep", "deep")); + registerCommand(new WarpCommand("nether", "nether")); + registerCommand(new WarpCommand("isle", "isle")); + registerCommand(new WarpCommand("crimson", "crimson")); + registerCommand(new WarpCommand("mines", "mines")); + registerCommand(new WarpCommand("forge", "forge")); + registerCommand(new WarpCommand("crystals", "crystals")); + registerCommand(new WarpCommand("gold", "gold")); + registerCommand(new WarpCommand("desert", "desert")); + registerCommand(new WarpCommand("spider", "spider")); + registerCommand(new WarpCommand("barn", "barn")); + registerCommand(new WarpCommand("end", "end")); + registerCommand(new WarpCommand("park", "park")); + registerCommand(new WarpCommand("castle", "castle")); + registerCommand(new WarpCommand("museum", "museum")); + registerCommand(new WarpCommand("da", "da")); + registerCommand(new WarpCommand("crypt", "crypt")); + registerCommand(new WarpCommand("nest", "nest")); + registerCommand(new WarpCommand("void", "void")); + registerCommand(new WarpCommand("drag", "dragon")); + registerCommand(new WarpCommand("jungle", "jungle")); + registerCommand(new WarpCommand("howl", "howl")); + registerCommand(new WarpCommand("dun", "dungeon_hub")); + } + +} -- cgit From 5f6ce80319b21d53abbec15886f4e2fbd765f748 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 22 Apr 2022 22:28:55 +0200 Subject: fixed HighlightCommissions --- src/main/java/me/Danker/utils/Utils.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index c9021f7..0fa2d0a 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -8,6 +8,8 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; @@ -18,6 +20,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.*; +import org.lwjgl.opengl.GL11; import java.util.*; import java.util.regex.Matcher; @@ -491,6 +494,20 @@ public class Utils { return (Math.floor(level / 2D) + 25) / 100D; } + public static void drawOnSlot(int size, int xSlotPos, int ySlotPos, int colour) { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int guiLeft = (sr.getScaledWidth() - 176) / 2; + int guiTop = (sr.getScaledHeight() - 222) / 2; + int x = guiLeft + xSlotPos; + int y = guiTop + ySlotPos; + // Move down when chest isn't 6 rows + if (size != 90) y += (6 - (size - 36) / 9) * 9; + + GL11.glTranslated(0, 0, 1); + Gui.drawRect(x, y, x + 16, y + 16, colour); + GL11.glTranslated(0, 0, -1); + } + public enum DungeonFloor { NONE, E0, -- cgit