diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index d5fd46b5..75029bde 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -84,6 +84,15 @@ public class DisguiseConfig { private static UpdatesBranch updatesBranch = UpdatesBranch.SAME_BUILDS; private static int playerDisguisesTablistExpires; private static boolean dynamicExpiry; + private static boolean playerHideArmor; + + public static boolean isPlayerHideArmor() { + return playerHideArmor; + } + + public static void setPlayerHideArmor(boolean playerHiddenArmor) { + playerHideArmor = playerHiddenArmor; + } public static boolean isDynamicExpiry() { return dynamicExpiry; @@ -340,6 +349,7 @@ public class DisguiseConfig { setUUIDGeneratedVersion(config.getInt("UUIDVersion")); setPlayerDisguisesTablistExpires(config.getInt("PlayerDisguisesTablistExpires")); setDynamicExpiry(config.getBoolean("DynamicExpiry")); + setPlayerHideArmor(config.getBoolean("PlayerHideArmor")); if (!LibsPremium.isPremium() && (isSavePlayerDisguises() || isSaveEntityDisguises())) { DisguiseUtilities.getLogger().warning("You must purchase the plugin to use saved disguises!"); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java index 2b9e36cb..22957802 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java @@ -39,7 +39,7 @@ public class PacketHandlerEquipment implements IPacketHandler { @Override public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, Entity entity) { - if (packetsHandler.isCancelMeta(disguise, observer)) { + if (DisguiseConfig.isPlayerHideArmor() && packetsHandler.isCancelMeta(disguise, observer)) { packets.clear(); PacketContainer equipPacket = sentPacket.shallowClone(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java index 62c1d1ca..4b26a882 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java @@ -380,7 +380,8 @@ public class PacketHandlerSpawn implements IPacketHandler { // If armor must be sent because its currently not displayed and would've been sent normally boolean delayedArmor = - (disguise.isPlayerDisguise() && disguisedEntity != observer) && disguisedEntity instanceof LivingEntity; + DisguiseConfig.isPlayerHideArmor() && (disguise.isPlayerDisguise() && disguisedEntity != observer) && + disguisedEntity instanceof LivingEntity; // This sends the armor packets so that the player isn't naked. if (DisguiseConfig.isEquipmentPacketsEnabled() || delayedArmor) { for (EquipmentSlot slot : EquipmentSlot.values()) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index eb772bb2..803b2e15 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -215,6 +215,11 @@ DisableInvisibility: false # Expired message can be hidden with an empty translation message DynamicExpiry: false +# Some players have issues with conflicting plugins where disguised entities will show the wrong armor +# This should be left alone unless you're trying to solve this issue. Such as MM and stone blocks. +# When true, the plugin will hide player disguises armor to prevent a minor visual bug for half a second +PlayerHideArmor: true + # This will help performance, especially with CPU # Due to safety reasons, self disguises can never have their packets disabled. PacketsEnabled: