Few more comparison changes.
This commit is contained in:
parent
44b066ae3d
commit
9c392e70df
|
@ -150,7 +150,7 @@ public abstract class NPC {
|
|||
|
||||
shown.remove(player.getUniqueId());
|
||||
|
||||
if (player.getWorld() == location.getWorld() && player.getLocation().distance(location) <= autoHideDistance) {
|
||||
if (player.getWorld().equals(location.getWorld()) && player.getLocation().distance(location) <= autoHideDistance) {
|
||||
sendHidePackets(player);
|
||||
} else {
|
||||
if (autoHidden.contains(player.getUniqueId())) {
|
||||
|
|
|
@ -28,7 +28,7 @@ public class ChunkListener implements Listener {
|
|||
for (NPC npc : NPCManager.getAllNPCs()) {
|
||||
Chunk npcChunk = npc.getLocation().getChunk();
|
||||
|
||||
if (chunk.getX() == npcChunk.getX() && chunk.getZ() == npcChunk.getZ()) {
|
||||
if (chunk.equals(npcChunk)) {
|
||||
// Unloaded chunk with NPC in it. Hiding it from all players currently shown to.
|
||||
|
||||
for (UUID uuid : npc.getShown()) {
|
||||
|
@ -62,7 +62,7 @@ public class ChunkListener implements Listener {
|
|||
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
|
||||
if (npcChunk.getWorld() != player.getWorld()) {
|
||||
if (!npcChunk.getWorld().equals(player.getWorld())) {
|
||||
continue; // Player and NPC are not in the same world.
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue