Fix errors on world change
This commit is contained in:
parent
1fba0d9ff0
commit
2d3f6e46a3
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue