diff options
author | bowser0000 <bowser0000@gmail.com> | 2021-07-24 01:54:57 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2021-07-24 01:54:57 -0400 |
commit | bc3f389c52aef41f6fb4351e8d0a5a8fed8336ef (patch) | |
tree | 8baeb2c8381453aa07f12a40f56d986e78aab07a /src/main/java/me/Danker/commands | |
parent | 59ee50124930d73cd9fd6daa23727ff8a154c37d (diff) | |
download | SkyblockMod-bc3f389c52aef41f6fb4351e8d0a5a8fed8336ef.tar.gz SkyblockMod-bc3f389c52aef41f6fb4351e8d0a5a8fed8336ef.tar.bz2 SkyblockMod-bc3f389c52aef41f6fb4351e8d0a5a8fed8336ef.zip |
Add crystal hollows waypoints
With support for SBE crystal hollows waypoints
Diffstat (limited to 'src/main/java/me/Danker/commands')
3 files changed, 70 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java new file mode 100644 index 0000000..c545447 --- /dev/null +++ b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java @@ -0,0 +1,50 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.CrystalHollowWaypoints; +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 CrystalHollowWaypointCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dsmaddcrystalhollowwaypoints"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " <formatted waypoint>"; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + EntityPlayer player = (EntityPlayer) arg0; + + if (arg1.length == 0) return; + + String[] waypoints = String.join(" ", arg1).split("\\\\n"); + + for (String waypoint : waypoints) { + String[] parts = waypoint.split("@"); + String[] coords = parts[1].split(","); + + String location = parts[0]; + BlockPos pos = new BlockPos(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); + CrystalHollowWaypoints.Waypoint newWaypoint = new CrystalHollowWaypoints.Waypoint(location, pos); + + CrystalHollowWaypoints.waypoints.add(newWaypoint); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + newWaypoint.location + " @ " + newWaypoint.getPos())); + } + } + +} diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 9561074..dc6845d 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -100,6 +100,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); debug.append("[endoffarmalert][").append(ToggleCommand.endOfFarmAlert).append("]\n"); debug.append("[gemstonelore][").append(ToggleCommand.gemstoneLore).append("]\n"); + debug.append("[crystalhollowwaypoints][").append(ToggleCommand.crystalHollowWaypoints).append("]\n"); + debug.append("[crystalautowaypoints][").append(ToggleCommand.crystalAutoWaypoints).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"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index d52ee76..061a277 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -41,6 +41,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean customColouredNames; public static boolean endOfFarmAlert; public static boolean gemstoneLore; + public static boolean crystalHollowWaypoints; + public static boolean crystalAutoWaypoints; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -92,7 +94,6 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/ghostdisplay/chatmaddox/spiritbearalert/" + "sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/" + //ghosttimer "skill50display/outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/" + @@ -102,11 +103,12 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + + "dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { - return new ToggleCommand().getCommandUsage(arg0); + return "/toggle <too many to list>"; } @Override @@ -132,7 +134,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", - "gemstonelore", "list"); + "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "list"); } return null; } @@ -449,6 +451,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "GemstoneLore", gemstoneLore); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Gemstone in lore has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + gemstoneLore + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "crystalhollowwaypoints": + crystalHollowWaypoints = !crystalHollowWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", crystalHollowWaypoints); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Crystal Hollows waypoints has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalHollowWaypoints + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "crystalautowaypoints": + crystalAutoWaypoints = !crystalAutoWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", crystalAutoWaypoints); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto Crystal Hollows waypoints has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalAutoWaypoints + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -520,6 +532,8 @@ public class ToggleCommand extends CommandBase implements ICommand { 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 + " Gemstone in lore: " + DankersSkyblockMod.VALUE_COLOUR + gemstoneLore + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowWaypoints + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Auto Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalAutoWaypoints + "\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 |