mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-02 13:31:43 +01:00
Fix lookclose target invalidation
This commit is contained in:
parent
ecae2dbe8a
commit
9090d1c69b
@ -82,8 +82,7 @@ public class Skin {
|
|||||||
NPC npc = entity.getNPC();
|
NPC npc = entity.getNPC();
|
||||||
|
|
||||||
// Use npc cached skin if available.
|
// Use npc cached skin if available.
|
||||||
// If npc requires latest skin, cache is used for faster
|
// If npc requires latest skin, cache is used for faster availability until the latest skin can be loaded.
|
||||||
// availability until the latest skin can be loaded.
|
|
||||||
String cachedName = npc.data().get(CACHED_SKIN_UUID_NAME_METADATA);
|
String cachedName = npc.data().get(CACHED_SKIN_UUID_NAME_METADATA);
|
||||||
String texture = npc.data().get(NPC.PLAYER_SKIN_TEXTURE_PROPERTIES_METADATA, "cache");
|
String texture = npc.data().get(NPC.PLAYER_SKIN_TEXTURE_PROPERTIES_METADATA, "cache");
|
||||||
if (this.skinName.equals(cachedName) && !texture.equals("cache")) {
|
if (this.skinName.equals(cachedName) && !texture.equals("cache")) {
|
||||||
|
@ -100,7 +100,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
|||||||
if (lookingAt == null)
|
if (lookingAt == null)
|
||||||
return true;
|
return true;
|
||||||
if (!lookingAt.isOnline() || lookingAt.getWorld() != npc.getEntity().getWorld()
|
if (!lookingAt.isOnline() || lookingAt.getWorld() != npc.getEntity().getWorld()
|
||||||
|| lookingAt.getLocation(PLAYER_LOCATION).distanceSquared(NPC_LOCATION) > range) {
|
|| lookingAt.getLocation(PLAYER_LOCATION).distanceSquared(NPC_LOCATION) > range * range) {
|
||||||
lookingAt = null;
|
lookingAt = null;
|
||||||
}
|
}
|
||||||
return lookingAt == null;
|
return lookingAt == null;
|
||||||
|
Loading…
Reference in New Issue
Block a user