Few more comparison changes.
This commit is contained in:
@@ -150,7 +150,7 @@ public abstract class NPC {
|
|||||||
|
|
||||||
shown.remove(player.getUniqueId());
|
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);
|
sendHidePackets(player);
|
||||||
} else {
|
} else {
|
||||||
if (autoHidden.contains(player.getUniqueId())) {
|
if (autoHidden.contains(player.getUniqueId())) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class ChunkListener implements Listener {
|
|||||||
for (NPC npc : NPCManager.getAllNPCs()) {
|
for (NPC npc : NPCManager.getAllNPCs()) {
|
||||||
Chunk npcChunk = npc.getLocation().getChunk();
|
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.
|
// Unloaded chunk with NPC in it. Hiding it from all players currently shown to.
|
||||||
|
|
||||||
for (UUID uuid : npc.getShown()) {
|
for (UUID uuid : npc.getShown()) {
|
||||||
@@ -62,7 +62,7 @@ public class ChunkListener implements Listener {
|
|||||||
|
|
||||||
Player player = Bukkit.getPlayer(uuid);
|
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.
|
continue; // Player and NPC are not in the same world.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user