diff --git a/src/main/java/com/bgsoftware/wildloaders/npc/NPCIdentifier.java b/src/main/java/com/bgsoftware/wildloaders/npc/NPCIdentifier.java index d99f455..89c37a1 100644 --- a/src/main/java/com/bgsoftware/wildloaders/npc/NPCIdentifier.java +++ b/src/main/java/com/bgsoftware/wildloaders/npc/NPCIdentifier.java @@ -12,7 +12,7 @@ public final class NPCIdentifier { private final Object identifier; public NPCIdentifier(Location location){ - this.identifier = PER_WORLD_NPCS ? location.getWorld() : location; + this.identifier = PER_WORLD_NPCS ? location.getWorld() : getBlockLocation(location); } public Location getSpawnLocation(){ @@ -37,4 +37,8 @@ public final class NPCIdentifier { return Objects.hash(identifier); } + private static Location getBlockLocation(Location location){ + return new Location(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ()); + } + }