Only resend the player disguise if there is changes that will be noticed.

This commit is contained in:
libraryaddict 2014-07-03 21:30:09 +12:00
parent 8410904f94
commit 1df5f6723e
2 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,7 @@ public class PlayerDisguise extends TargetedDisguise {
public void onLookup(WrappedGameProfile gameProfile) { public void onLookup(WrappedGameProfile gameProfile) {
if (currentLookup == this && gameProfile != null) { if (currentLookup == this && gameProfile != null) {
setSkin(gameProfile); setSkin(gameProfile);
if (DisguiseUtilities.isDisguiseInUse(PlayerDisguise.this)) { if (!gameProfile.getProperties().isEmpty() && DisguiseUtilities.isDisguiseInUse(PlayerDisguise.this)) {
DisguiseUtilities.refreshTrackers(PlayerDisguise.this); DisguiseUtilities.refreshTrackers(PlayerDisguise.this);
} }
} }

View File

@ -343,7 +343,9 @@ public class DisguiseUtilities {
if (remove) { if (remove) {
getAddedByPlugins().remove(disguise.getName().toLowerCase()); 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); DisguiseUtilities.refreshTrackers(disguise);
} }
} }