From 03ed547630a83d2a9d77bdd1772e71ae975904ff Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 16 Jul 2017 13:09:06 +0800 Subject: [PATCH] v2.4.1 Bugfix --- .../St3venAU/plugins/ArmorStandTools/ArmorStandGUI.java | 2 +- src/com/gmail/St3venAU/plugins/ArmorStandTools/NMS.java | 8 ++++++-- src/config.yml | 2 +- src/language.yml | 2 +- src/plugin.yml | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/com/gmail/St3venAU/plugins/ArmorStandTools/ArmorStandGUI.java b/src/com/gmail/St3venAU/plugins/ArmorStandTools/ArmorStandGUI.java index f4a1f61..32aa69d 100644 --- a/src/com/gmail/St3venAU/plugins/ArmorStandTools/ArmorStandGUI.java +++ b/src/com/gmail/St3venAU/plugins/ArmorStandTools/ArmorStandGUI.java @@ -97,7 +97,7 @@ class ArmorStandGUI implements Listener { case INVUL: return Utils.setLore(item, ChatColor.AQUA + Config.invul + ": " + (Main.nms.isInvulnerable(as) ? (ChatColor.GREEN + Config.isOn) : (ChatColor.RED + Config.isOff))); case SLOTS: - return Utils.setLore(item, ChatColor.AQUA + Config.equip + ": " + (Main.nms.getDisabledSlots(as) == 2039583 ? (ChatColor.GREEN + Config.locked) : (ChatColor.RED + Config.unLocked))); + return Utils.setLore(item, ChatColor.AQUA + Config.equip + ": " + (Main.nms.equipmentLocked(as) ? (ChatColor.GREEN + Config.locked) : (ChatColor.RED + Config.unLocked))); case NAME: return Utils.setLore(item, ChatColor.AQUA + Config.currently + ": " + (as.getCustomName() == null ? (ChatColor.BLUE + Config.none) : (ChatColor.GREEN + as.getCustomName()))); case PHEAD: diff --git a/src/com/gmail/St3venAU/plugins/ArmorStandTools/NMS.java b/src/com/gmail/St3venAU/plugins/ArmorStandTools/NMS.java index e46fa08..5b65073 100644 --- a/src/com/gmail/St3venAU/plugins/ArmorStandTools/NMS.java +++ b/src/com/gmail/St3venAU/plugins/ArmorStandTools/NMS.java @@ -100,12 +100,16 @@ abstract class NMS { } f.setAccessible(true); try { - f.set(nmsEntity, slotsDisabled ? 2039583 : 0); + f.set(nmsEntity, slotsDisabled ? 0xFFFFFF : 0); } catch (IllegalAccessException e) { e.printStackTrace(); } } + boolean equipmentLocked(ArmorStand as) { + return getDisabledSlots(as) == 0xFFFFFF; + } + Object getNmsEntity(org.bukkit.entity.Entity entity) { try { return entity.getClass().getMethod("getHandle").invoke(entity); @@ -382,7 +386,7 @@ abstract class NMS { clone.setCustomName(as.getCustomName()); clone.setCustomNameVisible(as.isCustomNameVisible()); clone.setSmall(as.isSmall()); - setSlotsDisabled(clone, getDisabledSlots(as) == 2039583); + setSlotsDisabled(clone, getDisabledSlots(as) == 0xFFFFFF); setInvulnerable(clone, isInvulnerable(as)); if(Main.nms.supportsScoreboardTags()) { ArmorStandCmd.cloneASCommand(as, clone); diff --git a/src/config.yml b/src/config.yml index 315bab4..4870bdc 100644 --- a/src/config.yml +++ b/src/config.yml @@ -4,7 +4,7 @@ # # Main Config # -# File generated by: v2.4.1 +# File generated by: v2.4.2 # (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/language.yml b/src/language.yml index ff1b94b..87e242b 100644 --- a/src/language.yml +++ b/src/language.yml @@ -4,7 +4,7 @@ # # Language Config # -# File generated by: v2.4.1 +# File generated by: v2.4.2 # (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 ea7d224..edc2ae6 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ main: com.gmail.St3venAU.plugins.ArmorStandTools.Main name: ArmorStandTools -version: 2.4.1 +version: 2.4.2 author: St3venAU description: Armor stand manipulation tools softdepend: [WorldGuard, PlotSquared]