mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 19:46:15 +01:00
Fix a multiworld issue in LookClose
This commit is contained in:
parent
c5e95eb667
commit
32445afec6
@ -88,7 +88,8 @@ public class LookClose extends Trait implements Runnable, Toggleable {
|
|||||||
private boolean hasInvalidTarget() {
|
private boolean hasInvalidTarget() {
|
||||||
if (lookingAt == null)
|
if (lookingAt == null)
|
||||||
return true;
|
return true;
|
||||||
if (!lookingAt.isOnline() || lookingAt.getLocation().distanceSquared(npc.getBukkitEntity().getLocation()) > 5) {
|
if (!lookingAt.isOnline() || lookingAt.getWorld() != npc.getBukkitEntity().getWorld()
|
||||||
|
|| lookingAt.getLocation().distanceSquared(npc.getBukkitEntity().getLocation()) > 5) {
|
||||||
lookingAt = null;
|
lookingAt = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user