From 63ace6a84b4aec11b25a104e4f669d3dd7629d2a Mon Sep 17 00:00:00 2001 From: OmerBenGera Date: Sat, 12 Jun 2021 20:03:08 +0300 Subject: [PATCH] Fixed identifiers not working correctly causing issues with loaders --- .../java/com/bgsoftware/wildloaders/npc/NPCIdentifier.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); + } + }