This commit is contained in:
mfnalex 2021-09-29 15:58:36 +02:00
parent db1ceaa809
commit 8d122d19a2
4 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -9,7 +9,7 @@
<name>ChestSort</name>
<url>https://www.chestsort.de</url>
<description>Allows automatic chest sorting!</description>
<version>11.5.2</version>
<version>11.5.3</version>
<packaging>jar</packaging>
<properties>

View File

@ -196,7 +196,7 @@ public class ChestSortPlugin extends JavaPlugin {
}
public ArrayList<String> getDisabledWorlds() {
return disabledWorlds;
return disabledWorlds == null ? new ArrayList<>() : disabledWorlds;
}
public void setDisabledWorlds(ArrayList<String> disabledWorlds) {

View File

@ -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;