Refactored chunk object comparison.
Object#equals checks values inside the object. == only returns true if they refer to the same object.
This commit is contained in:
parent
c51f522874
commit
5f9467e265
|
@ -51,7 +51,7 @@ public class ChunkListener implements Listener {
|
|||
for (NPC npc : NPCManager.getAllNPCs()) {
|
||||
Chunk npcChunk = npc.getLocation().getChunk();
|
||||
|
||||
if (chunk == npcChunk) {
|
||||
if (chunk.equals(npcChunk)) {
|
||||
// Loaded chunk with NPC in it. Showing it to the players again.
|
||||
|
||||
for (UUID uuid : npc.getShown()) {
|
||||
|
|
Loading…
Reference in New Issue