diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-15 21:29:51 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-15 21:29:51 -0230 |
commit | 9c759882a1a92593fae687d19106b4a348fc7a4b (patch) | |
tree | b29343929ef2fb617a47ba07d2c0e1160f820741 /src/main/java/com/thatgravyboat/skyblockhud/handlers | |
parent | c63a02e77465296e9b6b099ff61451ee67c8c850 (diff) | |
download | SkyblockHud-Death-Defied-9c759882a1a92593fae687d19106b4a348fc7a4b.tar.gz SkyblockHud-Death-Defied-9c759882a1a92593fae687d19106b4a348fc7a4b.tar.bz2 SkyblockHud-Death-Defied-9c759882a1a92593fae687d19106b4a348fc7a4b.zip |
Added move command for waypoints and updated trackers thanks Jani
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/handlers')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java index 6354591..1e63a0b 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java @@ -42,10 +42,8 @@ public class CrystalWaypoints { @SubscribeEvent public void onWorldChange(EntityJoinWorldEvent event) { - if (event.entity != null) { - if (event.entity.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { - waypoints.clear(); - } + if (event.entity == Minecraft.getMinecraft().thePlayer) { + waypoints.clear(); } } @@ -95,6 +93,15 @@ public class CrystalWaypoints { } } break; + case "move": + if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) { + if (CrystalWaypoints.waypoints.containsKey(name)) { + CrystalWaypoints.waypoints.put(name, sender.getPosition().add(0.5, 0.5, 0.5)); + } else { + sbhMessage(sender, "Waypoint doesnt exist!"); + } + } + break; case "clear": CrystalWaypoints.waypoints.clear(); break; @@ -129,11 +136,11 @@ public class CrystalWaypoints { new TabCompleteRunnable() { @Override public List<String> tabComplete(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 2 && (args[0].equalsIgnoreCase("remove") || args[0].equalsIgnoreCase("copy"))) { + if (args.length == 2 && Utils.equalsIgnoreCaseAnyOf (args[0], "remove","copy", "move")) { return getListOfStringsMatchingLastWord(args, waypoints.keySet()); } if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, Lists.newArrayList("add", "clear", "remove", "copy", "addat")); + return getListOfStringsMatchingLastWord(args, Lists.newArrayList("add", "clear", "remove", "copy", "addat", "move")); } if (args.length > 1 && args[0].equalsIgnoreCase("addat")) { return func_175771_a(args, 1, pos); |