diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-11-23 09:57:06 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-11-23 09:57:06 -0500 |
commit | ea9c0616fd3406c3a93995f6ab28309fe6cd8e05 (patch) | |
tree | 7b70a262a6be2b72205ce27da02cb7d3bda2dbf7 /src/main/java/me/Danker/commands | |
parent | b89d16855374a3e75c4c1279226d23d923821084 (diff) | |
download | SkyblockMod-ea9c0616fd3406c3a93995f6ab28309fe6cd8e05.tar.gz SkyblockMod-ea9c0616fd3406c3a93995f6ab28309fe6cd8e05.tar.bz2 SkyblockMod-ea9c0616fd3406c3a93995f6ab28309fe6cd8e05.zip |
Add skill xp/hour tracker, add Necron's Handle and bug fixes
Fix F7 loot not saving to config
Fix water puzzle variant 3 solution
Diffstat (limited to 'src/main/java/me/Danker/commands')
5 files changed, 120 insertions, 7 deletions
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 4fadb54..d514fbd 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -40,8 +40,8 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf/fishing/catacombs> [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" + EnumChatFormatting.GOLD + " /display <zombie/spider/wolf/fishing/catacombs/auto/off> [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active.\n" + EnumChatFormatting.GOLD + " /resetloot <zombie/spider/wolf/fishing/catacombs/confirm/cancel>" + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + - EnumChatFormatting.GOLD + " /move <coords/display/dungeontimer/skill50/lividhp/caketimer> <x> <y>" + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + - EnumChatFormatting.GOLD + " /scale <coords/display/dungeontimer/skill50/lividhp/caketimer> <scale (0.1 - 10)>" + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + + EnumChatFormatting.GOLD + " /move <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker> <x> <y>" + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + + EnumChatFormatting.GOLD + " /scale <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker> <scale (0.1 - 10)>" + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + EnumChatFormatting.GOLD + " /slayer [player]" + EnumChatFormatting.AQUA + " - Uses API to get slayer xp of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /skills [player]" + EnumChatFormatting.AQUA + " - Uses API to get skill levels of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + " /lobbyskills" + EnumChatFormatting.AQUA + " - Uses API to find the average skills of the lobby, as well the three players with the highest skill average.\n" + @@ -53,7 +53,9 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /importfishing" + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + EnumChatFormatting.GOLD + " /onlyslayer <zombie/spider/wolf> <1/2/3/4>" + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + - EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n")); + EnumChatFormatting.GOLD + " /skilltracker <start/stop/reset>" + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\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/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 867139f..f66d0c4 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -153,6 +153,7 @@ public class LootCommand extends CommandBase { public static int implosions; public static int witherShields; public static int shadowWarps; + public static int necronsHandles; public static int autoRecombs; public static int witherHelms; public static int witherChests; @@ -300,6 +301,7 @@ public class LootCommand extends CommandBase { public static int implosionsSession = 0; public static int witherShieldsSession = 0; public static int shadowWarpsSession = 0; + public static int necronsHandlesSession = 0; public static int autoRecombsSession = 0; public static int witherHelmsSession = 0; public static int witherChestsSession = 0; @@ -897,6 +899,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Implosions: " + nf.format(implosionsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Wither Shields: " + nf.format(witherShieldsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Shadow Warps: " + nf.format(shadowWarpsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Necron's Handles: " + nf.format(necronsHandlesSession) + "\n" + EnumChatFormatting.GOLD + " Auto Recombobulator: " + nf.format(autoRecombsSession) + "\n" + EnumChatFormatting.GOLD + " Wither Helmets: " + nf.format(witherHelmsSession) + "\n" + EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(witherChestsSession) + "\n" + @@ -916,6 +919,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " Implosions: " + nf.format(implosions) + "\n" + EnumChatFormatting.DARK_PURPLE + " Wither Shields: " + nf.format(witherShields) + "\n" + EnumChatFormatting.DARK_PURPLE + " Shadow Warps: " + nf.format(shadowWarps) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Necron's Handles: " + nf.format(necronsHandles) + "\n" + EnumChatFormatting.GOLD + " Auto Recombobulator: " + nf.format(autoRecombs) + "\n" + EnumChatFormatting.GOLD + " Wither Helmets: " + nf.format(witherHelms) + "\n" + EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(witherChests) + "\n" + diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 0581d8c..93e04a3 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -19,6 +19,7 @@ public class MoveCommand extends CommandBase { public static int[] skill50XY = {0, 0}; public static int[] lividHpXY = {0, 0}; public static int[] cakeTimerXY = {0, 0}; + public static int[] skillTrackerXY = {0, 0}; @Override public String getCommandName() { @@ -27,7 +28,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer> <x> <y>"; + return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker> <x> <y>"; } @Override @@ -38,7 +39,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"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker"); } return null; } @@ -87,6 +88,13 @@ public class MoveCommand extends CommandBase { cakeTimerXY[1] = Integer.parseInt(arg1[2]); ConfigHandler.writeIntConfig("locations", "cakeTimerX", cakeTimerXY[0]); ConfigHandler.writeIntConfig("locations", "cakeTimerY", cakeTimerXY[1]); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Cake timer has been moved to " + TheMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + } else if (arg1[0].equalsIgnoreCase("skilltracker")) { + skillTrackerXY[0] = Integer.parseInt(arg1[1]); + skillTrackerXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "skillTrackerX", skillTrackerXY[0]); + ConfigHandler.writeIntConfig("locations", "skillTrackerY", skillTrackerXY[1]); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker has been moved to " + TheMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); } else { player.addChatMessage(new ChatComponentText(TheMod.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 1527e40..cfc7282 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -19,6 +19,7 @@ public class ScaleCommand extends CommandBase { public static double skill50Scale; public static double lividHpScale; public static double cakeTimerScale; + public static double skillTrackerScale; @Override public String getCommandName() { @@ -27,7 +28,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer> <size (0.1 - 10)>"; + return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker> <size (0.1 - 10)>"; } @Override @@ -38,7 +39,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"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker"); } return null; } @@ -82,6 +83,10 @@ public class ScaleCommand extends CommandBase { cakeTimerScale = scaleAmount; ConfigHandler.writeDoubleConfig("scales", "cakeTimerScale", cakeTimerScale); player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Cake timer has been scaled to " + TheMod.SECONDARY_COLOUR + cakeTimerScale + "x")); + } else if (arg1[0].equalsIgnoreCase("skilltracker")) { + skillTrackerScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "skillTrackerScale", skillTrackerScale); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker has been scaled to " + TheMod.SECONDARY_COLOUR + skillTrackerScale + "x")); } else { player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/SkillTrackerCommand.java b/src/main/java/me/Danker/commands/SkillTrackerCommand.java new file mode 100644 index 0000000..6e6d742 --- /dev/null +++ b/src/main/java/me/Danker/commands/SkillTrackerCommand.java @@ -0,0 +1,94 @@ +package me.Danker.commands; + +import java.util.List; + +import org.apache.commons.lang3.time.StopWatch; + +import me.Danker.TheMod; +import me.Danker.handlers.ConfigHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; + +public class SkillTrackerCommand extends CommandBase { + + @Override + public String getCommandName() { + return "skilltracker"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " <start/stop/reset>"; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return getListOfStringsMatchingLastWord(args, "start", "resume", "pause", "stop", "reset", "hide", "show"); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + EntityPlayer player = (EntityPlayer) arg0; + + if (arg1.length < 1) { + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + switch (arg1[0].toLowerCase()) { + case "start": + case "resume": + if (TheMod.skillStopwatch.isStarted() && TheMod.skillStopwatch.isSuspended()) { + TheMod.skillStopwatch.resume(); + } else if (!TheMod.skillStopwatch.isStarted()) { + TheMod.skillStopwatch.start(); + } + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker started.")); + break; + case "pause": + case "stop": + if (TheMod.skillStopwatch.isStarted() && !TheMod.skillStopwatch.isSuspended()) { + TheMod.skillStopwatch.suspend(); + } else { + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker paused.")); + } + break; + case "reset": + TheMod.skillStopwatch = new StopWatch(); + TheMod.farmingXPGained = 0; + TheMod.miningXPGained = 0; + TheMod.combatXPGained = 0; + TheMod.foragingXPGained = 0; + TheMod.fishingXPGained = 0; + TheMod.enchantingXPGained = 0; + TheMod.alchemyXPGained = 0; + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker reset.")); + break; + case "hide": + TheMod.showSkillTracker = false; + ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", false); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker hidden.")); + break; + case "show": + TheMod.showSkillTracker = true; + ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", true); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Skill tracker shown.")); + break; + default: + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + } + } + +} |