From 39ca52ae8d4455b2f8193518f2b5f4ef0a0c5f48 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 31 May 2013 02:31:18 +1200 Subject: [PATCH] Fixed 2 small mistakes which could make people think bug. --- src/me/libraryaddict/disguise/DisguiseAPI.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index 88f2eaaf..2430827a 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -115,6 +115,7 @@ public class DisguiseAPI { break; } } else { + soundType = null; disguisedEntity = entity; break; } @@ -126,7 +127,7 @@ public class DisguiseAPI { if (disguise.replaceSounds()) { Sound sound = null; DisguiseSound dSound = DisguiseSound.getType(disguise.getType().name()); - if (dSound != null) + if (dSound != null && soundType != null) sound = dSound.getSound(soundType); if (sound == null) { event.setCancelled(true); @@ -164,6 +165,10 @@ public class DisguiseAPI { return disguises.containsKey(disguiser); } + /** + * @param Resends + * the entity to all the watching players, which is where the magic begins + */ private static void refresh(Entity entity) { EntityTrackerEntry entry = (EntityTrackerEntry) ((WorldServer) ((CraftEntity) entity).getHandle().world).tracker.trackedEntities .get(entity.getEntityId()); @@ -176,14 +181,6 @@ public class DisguiseAPI { entry.updatePlayer(player); } } - /* - // Get the tracker of the people who can see the hider - EntityTracker hidersTracker = ((WorldServer) hider.world).tracker; - // Get the entity tracker entry for the player - EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(observer.id); - if (entry != null) { - entry.clear(getHandle()); - }*/ } /**