From 1df5f6723ee240a6938fe44eef9b0388c2a4ce9a Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 3 Jul 2014 21:30:09 +1200 Subject: [PATCH] Only resend the player disguise if there is changes that will be noticed. --- .../libraryaddict/disguise/disguisetypes/PlayerDisguise.java | 2 +- .../libraryaddict/disguise/utilities/DisguiseUtilities.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java b/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java index e0aab30b..b6919b43 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java @@ -99,7 +99,7 @@ public class PlayerDisguise extends TargetedDisguise { public void onLookup(WrappedGameProfile gameProfile) { if (currentLookup == this && gameProfile != null) { setSkin(gameProfile); - if (DisguiseUtilities.isDisguiseInUse(PlayerDisguise.this)) { + if (!gameProfile.getProperties().isEmpty() && DisguiseUtilities.isDisguiseInUse(PlayerDisguise.this)) { DisguiseUtilities.refreshTrackers(PlayerDisguise.this); } } diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 100b3674..e6e7115a 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -343,7 +343,9 @@ public class DisguiseUtilities { if (remove) { getAddedByPlugins().remove(disguise.getName().toLowerCase()); } - if (DisguiseAPI.isDisguiseInUse(disguise)) { + if (DisguiseAPI.isDisguiseInUse(disguise) + && (!gameProfile.getName().equals(disguise.getName()) || !gameProfile.getProperties().isEmpty())) { + // TODO Resend for UUID? Might need to in the future. DisguiseUtilities.refreshTrackers(disguise); } }