Skip to content

Commit

Permalink
Remove deprecated method and double check world when resetting player…
Browse files Browse the repository at this point in the history
… skins
  • Loading branch information
fullwall committed Dec 19, 2015
1 parent 7a23f78 commit 5baf8f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java
Expand Up @@ -175,11 +175,6 @@ public void setTarget(Entity target, boolean aggressive) {
switchStrategyTo(newStrategy);
}

@Override
public void setTarget(LivingEntity target, boolean aggressive) {
setTarget((Entity) target, aggressive);
}

@Override
public void setTarget(Location target) {
if (!npc.isSpawned())
Expand Down
Expand Up @@ -219,8 +219,10 @@ private void resetNearbyPlayers(SkinnableEntity skinnable) {
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;

Expand Down

0 comments on commit 5baf8f7

Please sign in to comment.