Few more comparison changes.

This commit is contained in:
JitseB 2018-04-25 15:42:57 +02:00
parent 44b066ae3d
commit 9c392e70df
2 changed files with 3 additions and 3 deletions

View File

@ -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())) {

View File

@ -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.
}