aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands
diff options
context:
space:
mode:
authorSychic <47618543+Sychic@users.noreply.github.com>2020-12-26 16:16:25 -0500
committerGitHub <noreply@github.com>2020-12-26 16:16:25 -0500
commit3917028d62623f56428784f039af241bf5750a14 (patch)
tree0cb34d0fa5104990df8bcd4f72816bf252a6c4da /src/main/java/me/Danker/commands
parent3e4b6728eaee4daae95dfb8c40ed46510e9ea280 (diff)
parente00e8cc6b29b8c6826459c7d39e40b265640d22d (diff)
downloadSkyblockMod-3917028d62623f56428784f039af241bf5750a14.tar.gz
SkyblockMod-3917028d62623f56428784f039af241bf5750a14.tar.bz2
SkyblockMod-3917028d62623f56428784f039af241bf5750a14.zip
Merge branch 'development' into development
Diffstat (limited to 'src/main/java/me/Danker/commands')
-rw-r--r--src/main/java/me/Danker/commands/DHelpCommand.java2
-rw-r--r--src/main/java/me/Danker/commands/DankerGuiCommand.java3
-rw-r--r--src/main/java/me/Danker/commands/DungeonsCommand.java63
-rw-r--r--src/main/java/me/Danker/commands/MoveCommand.java14
-rw-r--r--src/main/java/me/Danker/commands/ScaleCommand.java10
-rw-r--r--src/main/java/me/Danker/commands/ToggleCommand.java25
6 files changed, 87 insertions, 30 deletions
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java
index f16f598..699374d 100644
--- a/src/main/java/me/Danker/commands/DHelpCommand.java
+++ b/src/main/java/me/Danker/commands/DHelpCommand.java
@@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase {
EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" +
EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" +
EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" +
- EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/lividdagger/flowerweapons/sceptremessages/midasstaffmessages/implosionmessages/healmessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" +
+ EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/lividdagger/flowerweapons/sceptremessages/midasstaffmessages/implosionmessages/healmessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/notifyslayerslain/necronnotifications/bonzotimer/blockbreakingfarms/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" +
EnumChatFormatting.GOLD + " /setkey <key>" + EnumChatFormatting.AQUA + " - Sets API key.\n" +
EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" +
EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf/fishing/catacombs/mythological/> [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" +
diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java
index 380086a..976f1eb 100644
--- a/src/main/java/me/Danker/commands/DankerGuiCommand.java
+++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java
@@ -61,6 +61,9 @@ public class DankerGuiCommand extends CommandBase {
debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n");
debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n");
debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n");
+ debug.append("[necronnotifications][").append(ToggleCommand.necronNotificationsToggled).append("]\n");
+ debug.append("[bonzotimer][").append(ToggleCommand.bonzoTimerToggled).append("]\n");
+ debug.append("[blockbreakingfarms][").append(ToggleCommand.blockBreakingFarmsToggled).append("]\n");
debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n");
debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n");
debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n");
diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java
index 290f99d..4179420 100644
--- a/src/main/java/me/Danker/commands/DungeonsCommand.java
+++ b/src/main/java/me/Danker/commands/DungeonsCommand.java
@@ -9,6 +9,7 @@ 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;
@@ -85,33 +86,53 @@ public class DungeonsCommand extends CommandBase {
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."));
- }
-
- double catacombs = Utils.xpToDungeonsLevel(dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject().get("experience").getAsDouble());
+ 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();
-
- player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
- EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" +
- EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\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" +
- DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
+
+ 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");
+
+ 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/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java
index e9bfe61..55ad695 100644
--- a/src/main/java/me/Danker/commands/MoveCommand.java
+++ b/src/main/java/me/Danker/commands/MoveCommand.java
@@ -21,7 +21,8 @@ public class MoveCommand extends CommandBase {
public static int[] cakeTimerXY = {0, 0};
public static int[] skillTrackerXY = {0, 0};
public static int[] waterAnswerXY = {0, 0};
-
+ public static int[] bonzoTimerXY = {0, 0};
+
@Override
public String getCommandName() {
return "move";
@@ -29,7 +30,7 @@ public class MoveCommand extends CommandBase {
@Override
public String getCommandUsage(ICommandSender arg0) {
- return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer> <x> <y>";
+ return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer> <x> <y>";
}
@Override
@@ -40,7 +41,7 @@ public class MoveCommand extends CommandBase {
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
if (args.length == 1) {
- return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer");
+ return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer");
}
return null;
}
@@ -111,6 +112,13 @@ public class MoveCommand extends CommandBase {
ConfigHandler.writeIntConfig("locations", "waterAnswerY", waterAnswerXY[1]);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Water solver answer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2]));
break;
+ case "bonzotimer":
+ bonzoTimerXY[0] = Integer.parseInt(arg1[1]);
+ bonzoTimerXY[1] = Integer.parseInt(arg1[2]);
+ ConfigHandler.writeIntConfig("locations", "bonzoTimerX", bonzoTimerXY[0]);
+ ConfigHandler.writeIntConfig("locations", "bonzoTimerX", bonzoTimerXY[1]);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2]));
+ break;
default:
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0)));
}
diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java
index 1c0843d..79b3cb1 100644
--- a/src/main/java/me/Danker/commands/ScaleCommand.java
+++ b/src/main/java/me/Danker/commands/ScaleCommand.java
@@ -21,6 +21,7 @@ public class ScaleCommand extends CommandBase {
public static double cakeTimerScale;
public static double skillTrackerScale;
public static double waterAnswerScale;
+ public static double bonzoTimerScale;
@Override
public String getCommandName() {
@@ -29,7 +30,7 @@ public class ScaleCommand extends CommandBase {
@Override
public String getCommandUsage(ICommandSender arg0) {
- return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer> <size (0.1 - 10)>";
+ return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer> <size (0.1 - 10)>";
}
@Override
@@ -40,7 +41,7 @@ public class ScaleCommand extends CommandBase {
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
if (args.length == 1) {
- return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer");
+ return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer");
}
return null;
}
@@ -101,6 +102,11 @@ public class ScaleCommand extends CommandBase {
ConfigHandler.writeDoubleConfig("scales", "waterAnswerScale", waterAnswerScale);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Water solver answer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + waterAnswerScale + "x"));
break;
+ case "bonzotimer":
+ bonzoTimerScale = scaleAmount;
+ ConfigHandler.writeDoubleConfig("scales", "bonzoTimerScale", bonzoTimerScale);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + bonzoTimerScale + "x"));
+ break;
default:
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0)));
}
diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java
index 8cc858f..0955264 100644
--- a/src/main/java/me/Danker/commands/ToggleCommand.java
+++ b/src/main/java/me/Danker/commands/ToggleCommand.java
@@ -45,6 +45,10 @@ public class ToggleCommand extends CommandBase implements ICommand {
public static boolean swapToPickBlockToggled;
public static boolean flowerWeaponsToggled;
public static boolean notifySlayerSlainToggled;
+ public static boolean necronNotificationsToggled;
+ public static boolean bonzoTimerToggled;
+ public static boolean blockBreakingFarmsToggled;
+
// Puzzle Solvers
public static boolean threeManToggled;
public static boolean oruoToggled;
@@ -73,9 +77,9 @@ public class ToggleCommand extends CommandBase implements ICommand {
public String getCommandUsage(ICommandSender arg0) {
return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalert/" +
- "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" +
+ "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" +
"outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/manamessages/caketimer/lowhealthnotify/" +
- "lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" +
+ "lividsolver/stopsalvagestarred/notifyslayerslain/necronnotifications/bonzotimer/blockbreakingfarms/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" +
"watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" +
"itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>";
}
@@ -93,7 +97,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
"flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts",
"expertiselore", "skill50display", "outlinetext", "midasstaffmessages",
"implosionmessages", "healmessages", "cooldownmessages", "manamessages", "caketimer", "lowhealthnotify",
- "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle",
+ "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "blockbreakingfarms", "threemanpuzzle", "oruopuzzle", "blazepuzzle",
"creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal",
"selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer",
"chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list");
@@ -252,6 +256,21 @@ public class ToggleCommand extends CommandBase implements ICommand {
ConfigHandler.writeBooleanConfig("toggles", "NotifySlayerSlain", notifySlayerSlainToggled);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Notify when slayer slain has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + notifySlayerSlainToggled + DankersSkyblockMod.MAIN_COLOUR + "."));
break;
+ case "necronnotifications":
+ necronNotificationsToggled = !necronNotificationsToggled;
+ ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", necronNotificationsToggled);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Necron phase notifications has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + "."));
+ break;
+ case "bonzotimer":
+ bonzoTimerToggled = !bonzoTimerToggled;
+ ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", bonzoTimerToggled);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + "."));
+ break;
+ case "blockbreakingfarms":
+ blockBreakingFarmsToggled = !blockBreakingFarmsToggled;
+ ConfigHandler.writeBooleanConfig("toggles", "BlockBreakingFarms", blockBreakingFarmsToggled);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Prevent breaking farms has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + "."));
+ break;
case "threemanpuzzle":
threeManToggled = !threeManToggled;
ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled);