From a6bb739e622f27639250cb6c3eaabadc12908a56 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 15 Feb 2018 22:15:56 +1300 Subject: [PATCH] Fixed tablist not being sent properly on undisguise --- .../disguise/disguisetypes/Disguise.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index 51adeee4..fa0a4bea 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -530,6 +530,21 @@ public abstract class Disguise { } } + // If this disguise is active + // Remove the disguise from the current disguises. + if (DisguiseUtilities.removeDisguise((TargetedDisguise) this)) { + if (getEntity() instanceof Player) { + DisguiseUtilities.removeSelfDisguise((Player) getEntity()); + } + + // Better refresh the entity to undisguise it + if (getEntity().isValid()) { + DisguiseUtilities.refreshTrackers((TargetedDisguise) this); + } else { + DisguiseUtilities.destroyEntity((TargetedDisguise) this); + } + } + if (isHidePlayer() && getEntity() instanceof Player && ((Player) getEntity()).isOnline()) { PlayerInfoData playerInfo = new PlayerInfoData( ReflectionManager.getGameProfile((Player) getEntity()), 0, @@ -553,21 +568,6 @@ public abstract class Disguise { e.printStackTrace(); } } - - // If this disguise is active - // Remove the disguise from the current disguises. - if (DisguiseUtilities.removeDisguise((TargetedDisguise) this)) { - if (getEntity() instanceof Player) { - DisguiseUtilities.removeSelfDisguise((Player) getEntity()); - } - - // Better refresh the entity to undisguise it - if (getEntity().isValid()) { - DisguiseUtilities.refreshTrackers((TargetedDisguise) this); - } else { - DisguiseUtilities.destroyEntity((TargetedDisguise) this); - } - } } else { // Loop through the disguises because it could be used with a unknown entity id. HashMap> future = DisguiseUtilities.getFutureDisguises();