3
0
Mirror von https://github.com/St3venAU/ArmorStandTools.git synchronisiert 2024-12-27 12:00:07 +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 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();

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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