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