3
0
Mirror von https://github.com/St3venAU/ArmorStandTools.git synchronisiert 2024-12-28 04:20:08 +01:00
Dieser Commit ist enthalten in:
Steven 2019-04-15 02:53:32 +08:00
Ursprung 82d3e26b58
Commit 47e7d857a5
5 geänderte Dateien mit 11 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -36,6 +36,7 @@ class Config {
static boolean debug = false; static boolean debug = false;
static boolean requireCreative = false; static boolean requireCreative = false;
static int defaultASCmdCooldownTicks = 0; static int defaultASCmdCooldownTicks = 0;
static boolean ignoreWGForASCmdExecution = false;
static String static String
invReturned, asDropped, asVisible, isTrue, isFalse, invReturned, asDropped, asVisible, isTrue, isFalse,
@ -145,6 +146,7 @@ class Config {
deactivateOnWorldChange = config.getBoolean("deactivateToolsOnWorldChange"); deactivateOnWorldChange = config.getBoolean("deactivateToolsOnWorldChange");
requireCreative = config.getBoolean("requireCreativeForSaveAsCmdBlock"); requireCreative = config.getBoolean("requireCreativeForSaveAsCmdBlock");
defaultASCmdCooldownTicks = config.getInt("defaultASCmdCooldownTicks"); defaultASCmdCooldownTicks = config.getInt("defaultASCmdCooldownTicks");
ignoreWGForASCmdExecution = config.getBoolean("bypassWorldguardForASCmdExecution");
debug = config.getBoolean("debug", false); debug = config.getBoolean("debug", false);
plugin.carryingArmorStand.clear(); plugin.carryingArmorStand.clear();

Datei anzeigen

@ -54,15 +54,15 @@ public class MainListener implements Listener {
@EventHandler @EventHandler
public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) { public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) {
if(!event.isCancelled() && event.getRightClicked() instanceof ArmorStand) { if(event.getRightClicked() instanceof ArmorStand) {
Player p = event.getPlayer(); Player p = event.getPlayer();
ArmorStand as = (ArmorStand) event.getRightClicked(); ArmorStand as = (ArmorStand) event.getRightClicked();
if(ArmorStandGUI.isInUse(as)) { if(!event.isCancelled() && ArmorStandGUI.isInUse(as)) {
Utils.actionBarMsg(p, Config.guiInUse); Utils.actionBarMsg(p, Config.guiInUse);
event.setCancelled(true); event.setCancelled(true);
return; 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)) { if (plugin.playerHasPermission(p, plugin.carryingArmorStand.get(p.getUniqueId()).getLocation().getBlock(), null)) {
plugin.carryingArmorStand.remove(p.getUniqueId()); plugin.carryingArmorStand.remove(p.getUniqueId());
Utils.actionBarMsg(p, Config.asDropped); Utils.actionBarMsg(p, Config.asDropped);
@ -73,7 +73,7 @@ public class MainListener implements Listener {
} }
} }
ArmorStandTool tool = ArmorStandTool.get(p); ArmorStandTool tool = ArmorStandTool.get(p);
if(tool != null) { if(!event.isCancelled() && tool != null) {
if (!plugin.playerHasPermission(p, as.getLocation().getBlock(), tool)) { if (!plugin.playerHasPermission(p, as.getLocation().getBlock(), tool)) {
p.sendMessage(ChatColor.RED + Config.generalNoPerm); p.sendMessage(ChatColor.RED + Config.generalNoPerm);
event.setCancelled(true); event.setCancelled(true);
@ -167,7 +167,7 @@ public class MainListener implements Listener {
event.setCancelled(cancel); event.setCancelled(cancel);
return; return;
} }
if(!p.isSneaking()) { if((Config.ignoreWGForASCmdExecution || !event.isCancelled()) && !p.isSneaking()) {
ArmorStandCmd asCmd = new ArmorStandCmd(as); ArmorStandCmd asCmd = new ArmorStandCmd(as);
if (asCmd.getCommand() != null) { if (asCmd.getCommand() != null) {
event.setCancelled(true); event.setCancelled(true);

Datei anzeigen

@ -4,7 +4,7 @@
# #
# Main Config # 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 # (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) # config to allow it to be re-created. There may be new config options)
# #
@ -56,6 +56,7 @@ allowMovingStandsBetweenWorlds: false
deactivateToolsOnWorldChange: true deactivateToolsOnWorldChange: true
requireCreativeForSaveAsCmdBlock: false requireCreativeForSaveAsCmdBlock: false
defaultASCmdCooldownTicks: 0 defaultASCmdCooldownTicks: 0
bypassWorldguardForASCmdExecution: false
helmet: AIR 0 helmet: AIR 0
chest: AIR 0 chest: AIR 0
pants: AIR 0 pants: AIR 0

Datei anzeigen

@ -4,7 +4,7 @@
# #
# Language Config # 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 # (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) # config to allow it to be re-created. There may be new config options)
# #

Datei anzeigen

@ -1,6 +1,6 @@
main: com.gmail.St3venAU.plugins.ArmorStandTools.Main main: com.gmail.St3venAU.plugins.ArmorStandTools.Main
name: ArmorStandTools name: ArmorStandTools
version: 3.3.0 version: 3.3.1
api-version: 1.13 api-version: 1.13
author: St3venAU author: St3venAU
description: Armor stand manipulation tools description: Armor stand manipulation tools