From 6085f2233d7f232d54171d57f6953e7d34a3fdcb Mon Sep 17 00:00:00 2001 From: fullwall Date: Sat, 19 Dec 2015 14:43:56 +0800 Subject: [PATCH] Remove deprecated method and double check world when resetting player skins --- .../java/net/citizensnpcs/npc/ai/CitizensNavigator.java | 5 ----- .../java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index a39431030..b53265ca2 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -175,11 +175,6 @@ public class CitizensNavigator implements Navigator, Runnable { switchStrategyTo(newStrategy); } - @Override - public void setTarget(LivingEntity target, boolean aggressive) { - setTarget((Entity) target, aggressive); - } - @Override public void setTarget(Location target) { if (!npc.isSpawned()) diff --git a/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java b/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java index 03b03378b..aaed71631 100644 --- a/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java +++ b/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java @@ -219,8 +219,10 @@ public class SkinUpdateTracker { for (Player player : players) { if (player.hasMetadata("NPC")) continue; - - double distanceSquared = player.getLocation(CACHE_LOCATION).distanceSquared(location); + Location ploc = player.getLocation(CACHE_LOCATION); + if (ploc.getWorld() != location.getWorld()) + continue; + double distanceSquared = ploc.distanceSquared(location); if (distanceSquared > viewDistance) continue;