From c225b57c2bc59b2f6af7a429bf0cf4d04aa73a2c Mon Sep 17 00:00:00 2001 From: Taah Date: Mon, 6 May 2024 12:39:19 -0700 Subject: [PATCH] woops --- .../java/dev/plex/extras/command/slime/MyWorldCommand.java | 4 ++++ .../dev/plex/extras/command/slime/SlimeManagerCommand.java | 4 ++++ src/main/java/dev/plex/extras/listener/WorldListener.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java b/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java index cf6820d..2fc20ef 100644 --- a/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java +++ b/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java @@ -38,6 +38,10 @@ public class MyWorldCommand extends PlexCommand { return usage(); } + if (!TFMExtras.getModule().enableIslands()) + { + return mmString("Islands are not enabled on this server!"); + } switch (args[0].toLowerCase()) { case "create" -> diff --git a/src/main/java/dev/plex/extras/command/slime/SlimeManagerCommand.java b/src/main/java/dev/plex/extras/command/slime/SlimeManagerCommand.java index 6e69fc2..ec88d5e 100644 --- a/src/main/java/dev/plex/extras/command/slime/SlimeManagerCommand.java +++ b/src/main/java/dev/plex/extras/command/slime/SlimeManagerCommand.java @@ -32,6 +32,10 @@ public class SlimeManagerCommand extends PlexCommand { return usage(); } + if (!TFMExtras.getModule().enableIslands()) + { + return mmString("SlimeWorldManager is not on this server!"); + } try { if (args[0].equalsIgnoreCase("delete")) diff --git a/src/main/java/dev/plex/extras/listener/WorldListener.java b/src/main/java/dev/plex/extras/listener/WorldListener.java index 2f5bf5a..78014f8 100644 --- a/src/main/java/dev/plex/extras/listener/WorldListener.java +++ b/src/main/java/dev/plex/extras/listener/WorldListener.java @@ -19,6 +19,7 @@ public class WorldListener extends PlexListener @EventHandler public void onBuild(BlockPlaceEvent event) { + if (!TFMExtras.getModule().enableIslands()) return; if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return; final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName()); final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner); @@ -42,6 +43,7 @@ public class WorldListener extends PlexListener @EventHandler public void onBreak(BlockBreakEvent event) { + if (!TFMExtras.getModule().enableIslands()) return; if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return; final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName()); final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner); @@ -63,6 +65,7 @@ public class WorldListener extends PlexListener @EventHandler public void onInteract(PlayerInteractEvent event) { + if (!TFMExtras.getModule().enableIslands()) return; if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return; final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName()); final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner); @@ -84,6 +87,7 @@ public class WorldListener extends PlexListener @EventHandler public void onWorldChange(PlayerChangedWorldEvent event) { + if (!TFMExtras.getModule().enableIslands()) return; if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return; final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName()); final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner);