Fix the disguises only refreshing theirselves

This commit is contained in:
Andrew 2013-08-13 22:05:13 +12:00
parent 2b2f5d4aed
commit f152c677c6

View file

@ -220,6 +220,8 @@ public class Disguise {
if (((CraftEntity) getEntity()).getHandle().valid) { if (((CraftEntity) getEntity()).getHandle().valid) {
// If this disguise is active // If this disguise is active
if (disguises.containsKey(getEntity().getEntityId()) && disguises.get(getEntity().getEntityId()) == this) { if (disguises.containsKey(getEntity().getEntityId()) && disguises.get(getEntity().getEntityId()) == this) {
// Now remove the disguise from the current disguises.
disguises.remove(getEntity().getEntityId());
// Gotta do reflection, copy code or open up calls. // Gotta do reflection, copy code or open up calls.
// Reflection is the cleanest? // Reflection is the cleanest?
if (entity instanceof Player) { if (entity instanceof Player) {
@ -227,8 +229,6 @@ public class Disguise {
} }
// Better refresh the entity to undisguise it // Better refresh the entity to undisguise it
disguiseAPI.refreshWatchingPlayers(getEntity()); disguiseAPI.refreshWatchingPlayers(getEntity());
// Now remove the disguise from the current disguises.
disguises.remove(getEntity().getEntityId());
} }
} }
} else { } else {