Fixed identifiers not working correctly causing issues with loaders

This commit is contained in:
OmerBenGera 2021-06-12 20:03:08 +03:00
parent b2bccb03d7
commit 63ace6a84b

View File

@ -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());
}
}