From 45909f3b28dedf9b371c435c6b0bb6c76f62b46e Mon Sep 17 00:00:00 2001 From: rockyhawk64 Date: Tue, 15 Dec 2020 19:28:35 +1100 Subject: [PATCH] v3.14.2.4 --- resource/config.yml | 4 +++- resource/plugin.yml | 2 +- .../openwithitem/HotbarItemLoader.java | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/resource/config.yml b/resource/config.yml index dfe7e3e..4af70b8 100644 --- a/resource/config.yml +++ b/resource/config.yml @@ -1,7 +1,9 @@ # |------------------------------------------------------------------------ # | CommandPanels Config File -# | By RockyHawk v4.2 +# | By RockyHawk v4.3 # | https://www.spigotmc.org/resources/command-panels-custom-guis.67788/ +# | +# | auto-update and minor-updates-only is HEAVILY RECOMMENDED # |------------------------------------------------------------------------ config: refresh-panels: true diff --git a/resource/plugin.yml b/resource/plugin.yml index 9e9cabb..5508c1b 100644 --- a/resource/plugin.yml +++ b/resource/plugin.yml @@ -1,4 +1,4 @@ -version: 3.14.2.3 +version: 3.14.2.4 main: me.rockyhawk.commandpanels.CommandPanels name: CommandPanels author: RockyHawk diff --git a/src/me/rockyhawk/commandpanels/openwithitem/HotbarItemLoader.java b/src/me/rockyhawk/commandpanels/openwithitem/HotbarItemLoader.java index 7edebf7..d198e14 100644 --- a/src/me/rockyhawk/commandpanels/openwithitem/HotbarItemLoader.java +++ b/src/me/rockyhawk/commandpanels/openwithitem/HotbarItemLoader.java @@ -39,7 +39,12 @@ public class HotbarItemLoader { if(openPanel) { String panelName = plugin.panelNames.get(temp[1])[0]; ConfigurationSection tempFile = YamlConfiguration.loadConfiguration(new File(plugin.panelsf + File.separator + plugin.panelFiles.get(Integer.parseInt(plugin.panelNames.get(temp[1])[1])))).getConfigurationSection("panels." + panelName); - //only open panel automatically if there are no commands + //only open panel automatically if there are no commands and player world is not disabled + if(tempFile.contains("disabled-worlds")){ + if(tempFile.getStringList("disabled-worlds").contains(p.getWorld().getName())){ + return false; + } + } if(tempFile.contains("open-with-item.commands")){ for(String command : tempFile.getStringList("open-with-item.commands")){ plugin.commandTags.commandTags(p,plugin.papi(p,command),command); @@ -76,7 +81,12 @@ public class HotbarItemLoader { } if(panelItem.isSimilar(invItem)){ if(openPanel) { - //only open panel automatically if there are no commands + //only open panel automatically if there are no commands and if world is not disabled + if(tempFile.contains("disabled-worlds")){ + if(tempFile.getStringList("disabled-worlds").contains(p.getWorld().getName())){ + return false; + } + } if(tempFile.contains("open-with-item.commands")){ for(String command : tempFile.getStringList("open-with-item.commands")){ plugin.commandTags.commandTags(p,plugin.papi(p,command),command);