From 8d122d19a2ebe6aaaf7605e3df886ee1830cf7a8 Mon Sep 17 00:00:00 2001 From: mfnalex <1122571+mfnalex@users.noreply.github.com> Date: Wed, 29 Sep 2021 15:58:36 +0200 Subject: [PATCH] 11.5.3 --- CHANGELOG.md | 3 +++ pom.xml | 2 +- src/main/java/de/jeff_media/chestsort/ChestSortPlugin.java | 2 +- src/main/java/de/jeff_media/chestsort/listeners/Listener.java | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec471aa..65e1d36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 11.5.3 +- Fixed "disabled-worlds" not working for "left-click hotkey" + ## 11.5.1 - Added support for new Slimefun API diff --git a/pom.xml b/pom.xml index fe5f6d4..ee95f43 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ChestSort https://www.chestsort.de Allows automatic chest sorting! - 11.5.2 + 11.5.3 jar diff --git a/src/main/java/de/jeff_media/chestsort/ChestSortPlugin.java b/src/main/java/de/jeff_media/chestsort/ChestSortPlugin.java index 5d68abd..c36cc41 100644 --- a/src/main/java/de/jeff_media/chestsort/ChestSortPlugin.java +++ b/src/main/java/de/jeff_media/chestsort/ChestSortPlugin.java @@ -196,7 +196,7 @@ public class ChestSortPlugin extends JavaPlugin { } public ArrayList getDisabledWorlds() { - return disabledWorlds; + return disabledWorlds == null ? new ArrayList<>() : disabledWorlds; } public void setDisabledWorlds(ArrayList disabledWorlds) { diff --git a/src/main/java/de/jeff_media/chestsort/listeners/Listener.java b/src/main/java/de/jeff_media/chestsort/listeners/Listener.java index 639d853..e19182d 100644 --- a/src/main/java/de/jeff_media/chestsort/listeners/Listener.java +++ b/src/main/java/de/jeff_media/chestsort/listeners/Listener.java @@ -56,6 +56,10 @@ public class Listener implements org.bukkit.event.Listener { @EventHandler public void onLeftClickChest(PlayerInteractEvent event) { + // checking in lower case for lazy admins + if (plugin.getDisabledWorlds().contains(event.getPlayer().getWorld().getName().toLowerCase())) { + return; + } if(!event.getPlayer().hasPermission("chestsort.use")) return; if(!event.getPlayer().hasPermission(Hotkey.getPermission(Hotkey.OUTSIDE))) return; if(event.getHand() != EquipmentSlot.HAND) return;