Cover terrain service NPCs and fix Citizens test imports

This commit is contained in:
unimatrixgit 2026-11-29 01:58:16 +01:00
commit b11145bfbb

View file

@ -190,7 +190,7 @@ public final class CitizensBridge implements Listener {
private void convert(LivingEntity legacy, Object registry) throws ReflectiveOperationException {
var marker = keys.stream().sorted(Comparator.comparing(NamespacedKey::toString)).filter(key -> legacy.getPersistentDataContainer().has(key)).findFirst().orElseThrow();
String markerValue = legacy.getPersistentDataContainer().has(marker, PersistentDataType.STRING) ? legacy.getPersistentDataContainer().get(marker, PersistentDataType.STRING) : null;
boolean unique = marker.toString().equals("dunecore:smuggler");
boolean unique = marker.toString().equals("dunecore:smuggler") || marker.toString().equals("dunerealms:spice-seller");
String stable = plugin.getName() + ":" + legacy.getWorld().getUID() + ":" + marker + ":" + (unique ? identity(legacy) : markerValue == null ? "1" : markerValue);
Object npc = null;
for (Object candidate : (Iterable<?>) registry) if (stable.equals(read(candidate, "dr-id"))) { npc = candidate; break; }