mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2024-12-23 16:58:35 +01:00
Fixed npcs have similar names causing weird behaviors with other plugins (#39)
This commit is contained in:
parent
fdfe5655e1
commit
6fdd0b578d
@ -16,10 +16,13 @@ import java.util.UUID;
|
||||
|
||||
public final class NPCHandler implements NPCManager {
|
||||
|
||||
private static int NPCS_COUNTER = 0;
|
||||
|
||||
private final WildLoadersPlugin plugin;
|
||||
private final Map<NPCIdentifier, ChunkLoaderNPC> npcs = Maps.newConcurrentMap();
|
||||
private final Map<NPCIdentifier, UUID> npcUUIDs = Maps.newConcurrentMap();
|
||||
|
||||
|
||||
public NPCHandler(WildLoadersPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@ -92,8 +95,7 @@ public final class NPCHandler implements NPCManager {
|
||||
}
|
||||
|
||||
public static String getName(String worldName) {
|
||||
String name = "Loader-" + worldName;
|
||||
return name.length() > 16 ? name.substring(0, 16) : name;
|
||||
return "Loader-" + (worldName.length() > 7 ? worldName.substring(0, 7) : worldName) + "-" + (NPCS_COUNTER++);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user