aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java')
-rw-r--r--src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java39
1 files changed, 39 insertions, 0 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..4eaf2d6
--- /dev/null
+++ b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java
@@ -0,0 +1,39 @@
+package me.Danker.commands;
+
+import me.Danker.features.CrystalHollowWaypoints;
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.CommandException;
+import net.minecraft.command.ICommandSender;
+
+import java.util.Arrays;
+
+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 {
+ if (arg1.length == 0) return;
+
+ if (arg1.length > 4 && arg1[0].equals("st")) {
+ String name = String.join(" ", Arrays.copyOfRange(arg1, 4, arg1.length));
+ CrystalHollowWaypoints.addWaypoint(name, arg1[1], arg1[2], arg1[3]);
+ } else {
+ CrystalHollowWaypoints.addDSMWaypoints(String.join(" ", arg1), false);
+ }
+ }
+
+}