diff options
author | bowser0000 <bowser0000@gmail.com> | 2021-07-05 12:52:46 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2021-07-05 12:52:46 -0400 |
commit | a44dc53ce80e9914595d5b646dc5623ddd3450b1 (patch) | |
tree | aa171433d7cc60b879c72a7c563e0bfb25a29257 /src/main/java/me/Danker/commands | |
parent | 17d42cffb8264a604e93052ee146887ae7fd32cb (diff) | |
download | SkyblockMod-a44dc53ce80e9914595d5b646dc5623ddd3450b1.tar.gz SkyblockMod-a44dc53ce80e9914595d5b646dc5623ddd3450b1.tar.bz2 SkyblockMod-a44dc53ce80e9914595d5b646dc5623ddd3450b1.zip |
Add alert when reaching end of farm
Diffstat (limited to 'src/main/java/me/Danker/commands')
4 files changed, 65 insertions, 2 deletions
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 42a82c4..b88f6cc 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -59,6 +59,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + PlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find skills, slayers, coins and weight of a player.\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" + 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/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index edec93f..4375d57 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -1,6 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import me.Danker.features.EndOfFarmAlert; import me.Danker.features.SkillTracker; import me.Danker.features.loot.LootDisplay; import net.minecraft.client.Minecraft; @@ -97,6 +98,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); + debug.append("[endoffarmalert][").append(ToggleCommand.endOfFarmAlert).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); @@ -113,6 +115,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[Current Display][").append(LootDisplay.display).append("]\n"); debug.append("[Auto Display][").append(LootDisplay.auto).append("]\n"); debug.append("[Skill Tracker Visible][").append(SkillTracker.showSkillTracker).append("]\n"); + debug.append("[Farm Length][").append(EndOfFarmAlert.min).append(" to ").append(EndOfFarmAlert.max).append("]\n"); debug.append("# Problematic Mods\n"); debug.append("[LabyMod][").append(DankersSkyblockMod.usingLabymod).append("]\n"); debug.append("[OAM][").append(DankersSkyblockMod.usingOAM).append("]\n"); diff --git a/src/main/java/me/Danker/commands/FarmLengthCommand.java b/src/main/java/me/Danker/commands/FarmLengthCommand.java new file mode 100644 index 0000000..6a28430 --- /dev/null +++ b/src/main/java/me/Danker/commands/FarmLengthCommand.java @@ -0,0 +1,50 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.EndOfFarmAlert; +import me.Danker.handlers.ConfigHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; + +public class FarmLengthCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dsmfarmlength"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " <min coords> <max coords>"; + } + + public static String usage(ICommandSender arg0) { + return new FarmLengthCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + EntityPlayer player = (EntityPlayer) arg0; + + if (arg1.length == 0) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Current Range: " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.min + DankersSkyblockMod.MAIN_COLOUR + " to " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.max)); + } else if (arg1.length < 2) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + EndOfFarmAlert.min = Double.parseDouble(arg1[0]); + EndOfFarmAlert.max = Double.parseDouble(arg1[1]); + ConfigHandler.writeDoubleConfig("misc", "farmMin", EndOfFarmAlert.min); + ConfigHandler.writeDoubleConfig("misc", "farmMax", EndOfFarmAlert.max); + } + +} diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 11b15f3..44b1df2 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -1,7 +1,9 @@ package me.Danker.commands; +import jdk.nashorn.internal.runtime.regexp.joni.Config; import me.Danker.DankersSkyblockMod; import me.Danker.features.CustomMusic; +import me.Danker.features.EndOfFarmAlert; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -38,6 +40,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean giantHP; public static boolean hidePetCandy; public static boolean customColouredNames; + public static boolean endOfFarmAlert; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -99,7 +102,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/hidepetcandy/customcolorednames/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -128,7 +131,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", - "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "list"); + "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", "list"); } return null; } @@ -435,6 +438,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "CustomColouredNames", customColouredNames); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom name colors has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + customColouredNames + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "endoffarmalert": + endOfFarmAlert = !endOfFarmAlert; + ConfigHandler.writeBooleanConfig("toggles", "EndOfFarmAlert", endOfFarmAlert); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "End of farm alert has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + endOfFarmAlert + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -504,6 +512,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Giant HP display: " + DankersSkyblockMod.VALUE_COLOUR + giantHP + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide pet candy: " + DankersSkyblockMod.VALUE_COLOUR + hidePetCandy + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom name colors: " + DankersSkyblockMod.VALUE_COLOUR + customColouredNames + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " End of farm alert: " + DankersSkyblockMod.VALUE_COLOUR + endOfFarmAlert + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic |