From 9bf3e81dedfaef1ff1c8c094aea9706f61fd851c Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 3 Feb 2020 17:42:47 +1300 Subject: [PATCH] Correct config value name for action bar, fix attributes error --- src/main/java/me/libraryaddict/disguise/DisguiseConfig.java | 4 ++-- .../me/libraryaddict/disguise/disguisetypes/Disguise.java | 2 +- .../packets/packethandlers/PacketHandlerAttributes.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index 60a57952..2f4ab0b5 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -207,7 +207,7 @@ public class DisguiseConfig { private static boolean retaliationCombat; @Getter @Setter - private static boolean actionBarDisguised; + private static boolean notifyPlayerDisguised; private DisguiseConfig() { } @@ -358,7 +358,7 @@ public class DisguiseConfig { setMovementPacketsEnabled(config.getBoolean("PacketsEnabled.Movement")); setNameAboveHeadAlwaysVisible(config.getBoolean("NameAboveHeadAlwaysVisible")); setNameOfPlayerShownAboveDisguise(config.getBoolean("ShowNamesAboveDisguises")); - setActionBarDisguised(config.getBoolean("ActionBarDisguised")); + setNotifyPlayerDisguised(config.getBoolean("NotifyPlayerDisguised")); setPlayerDisguisesTablistExpires(config.getInt("PlayerDisguisesTablistExpires")); setPlayerHideArmor(config.getBoolean("PlayerHideArmor")); setRetaliationCombat(config.getBoolean("RetaliationCombat")); diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index 749fbc38..ee2c4484 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -174,7 +174,7 @@ public abstract class Disguise { @Override public void run() { - if (DisguiseConfig.isActionBarDisguised() && getEntity() instanceof Player && + if (DisguiseConfig.isNotifyPlayerDisguised() && getEntity() instanceof Player && actionBarTicks++ % 20 == 0) { actionBarTicks = 0; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java index 5c64cc62..9a41f577 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java @@ -63,10 +63,10 @@ public class PacketHandlerAttributes implements IPacketHandler { } if (!attributes.isEmpty()) { - packets.getPackets().get(0).getIntegers().write(0, entity.getEntityId()); - packets.getPackets().get(0).getAttributeCollectionModifier().write(0, attributes); - packets.addPacket(updateAttributes); + + updateAttributes.getIntegers().write(0, entity.getEntityId()); + updateAttributes.getAttributeCollectionModifier().write(0, attributes); } } }