Fix errors on world change
This commit is contained in:
@@ -150,7 +150,7 @@ public abstract class NPC {
|
|||||||
|
|
||||||
shown.remove(player.getUniqueId());
|
shown.remove(player.getUniqueId());
|
||||||
|
|
||||||
if (player.getLocation().distance(location) <= autoHideDistance) {
|
if (player.getWorld() == location.getWorld() && player.getLocation().distance(location) <= autoHideDistance) {
|
||||||
sendHidePackets(player);
|
sendHidePackets(player);
|
||||||
} else {
|
} else {
|
||||||
if (autoHidden.contains(player.getUniqueId())) {
|
if (autoHidden.contains(player.getUniqueId())) {
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ public class PlayerListener implements Listener {
|
|||||||
npc.getAutoHidden().remove(player.getUniqueId());
|
npc.getAutoHidden().remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (npc.isActuallyShown(player)) {
|
if (npc.getShown().contains(player.getUniqueId())) {
|
||||||
npc.hide(player);
|
npc.getShown().remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user