From 47e7d857a5e888cb50489e1097cfd5ad51c281b0 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 15 Apr 2019 02:53:32 +0800 Subject: [PATCH] v3.3.1 --- .../gmail/St3venAU/plugins/ArmorStandTools/Config.java | 2 ++ .../St3venAU/plugins/ArmorStandTools/MainListener.java | 10 +++++----- src/config.yml | 3 ++- src/language.yml | 2 +- src/plugin.yml | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/com/gmail/St3venAU/plugins/ArmorStandTools/Config.java b/src/com/gmail/St3venAU/plugins/ArmorStandTools/Config.java index 12602f8..5f48cf7 100644 --- a/src/com/gmail/St3venAU/plugins/ArmorStandTools/Config.java +++ b/src/com/gmail/St3venAU/plugins/ArmorStandTools/Config.java @@ -36,6 +36,7 @@ class Config { static boolean debug = false; static boolean requireCreative = false; static int defaultASCmdCooldownTicks = 0; + static boolean ignoreWGForASCmdExecution = false; static String invReturned, asDropped, asVisible, isTrue, isFalse, @@ -145,6 +146,7 @@ class Config { deactivateOnWorldChange = config.getBoolean("deactivateToolsOnWorldChange"); requireCreative = config.getBoolean("requireCreativeForSaveAsCmdBlock"); defaultASCmdCooldownTicks = config.getInt("defaultASCmdCooldownTicks"); + ignoreWGForASCmdExecution = config.getBoolean("bypassWorldguardForASCmdExecution"); debug = config.getBoolean("debug", false); plugin.carryingArmorStand.clear(); diff --git a/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java b/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java index 65481d2..664a9cf 100644 --- a/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java +++ b/src/com/gmail/St3venAU/plugins/ArmorStandTools/MainListener.java @@ -54,15 +54,15 @@ public class MainListener implements Listener { @EventHandler public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) { - if(!event.isCancelled() && event.getRightClicked() instanceof ArmorStand) { + if(event.getRightClicked() instanceof ArmorStand) { Player p = event.getPlayer(); ArmorStand as = (ArmorStand) event.getRightClicked(); - if(ArmorStandGUI.isInUse(as)) { + if(!event.isCancelled() && ArmorStandGUI.isInUse(as)) { Utils.actionBarMsg(p, Config.guiInUse); event.setCancelled(true); return; } - if(plugin.carryingArmorStand.containsKey(p.getUniqueId())) { + if(!event.isCancelled() && plugin.carryingArmorStand.containsKey(p.getUniqueId())) { if (plugin.playerHasPermission(p, plugin.carryingArmorStand.get(p.getUniqueId()).getLocation().getBlock(), null)) { plugin.carryingArmorStand.remove(p.getUniqueId()); Utils.actionBarMsg(p, Config.asDropped); @@ -73,7 +73,7 @@ public class MainListener implements Listener { } } ArmorStandTool tool = ArmorStandTool.get(p); - if(tool != null) { + if(!event.isCancelled() && tool != null) { if (!plugin.playerHasPermission(p, as.getLocation().getBlock(), tool)) { p.sendMessage(ChatColor.RED + Config.generalNoPerm); event.setCancelled(true); @@ -167,7 +167,7 @@ public class MainListener implements Listener { event.setCancelled(cancel); return; } - if(!p.isSneaking()) { + if((Config.ignoreWGForASCmdExecution || !event.isCancelled()) && !p.isSneaking()) { ArmorStandCmd asCmd = new ArmorStandCmd(as); if (asCmd.getCommand() != null) { event.setCancelled(true); diff --git a/src/config.yml b/src/config.yml index e7873d0..dda89b9 100644 --- a/src/config.yml +++ b/src/config.yml @@ -4,7 +4,7 @@ # # Main Config # -# File generated by: v3.3.0 +# File generated by: v3.3.1 # (If this is not the version you are running, consider deleting this # config to allow it to be re-created. There may be new config options) # @@ -56,6 +56,7 @@ allowMovingStandsBetweenWorlds: false deactivateToolsOnWorldChange: true requireCreativeForSaveAsCmdBlock: false defaultASCmdCooldownTicks: 0 +bypassWorldguardForASCmdExecution: false helmet: AIR 0 chest: AIR 0 pants: AIR 0 diff --git a/src/language.yml b/src/language.yml index e73610f..66aac95 100644 --- a/src/language.yml +++ b/src/language.yml @@ -4,7 +4,7 @@ # # Language Config # -# File generated by: v3.3.0 +# File generated by: v3.3.1 # (If this is not the version you are running, consider deleting this # config to allow it to be re-created. There may be new config options) # diff --git a/src/plugin.yml b/src/plugin.yml index c061ef7..5b54604 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ main: com.gmail.St3venAU.plugins.ArmorStandTools.Main name: ArmorStandTools -version: 3.3.0 +version: 3.3.1 api-version: 1.13 author: St3venAU description: Armor stand manipulation tools