Abilities are now Stored by Name not UUID. Refactor Built In and Toggleable Abilities

This commit is contained in:
Kam committed 2026-02-17 23:08:12 -05:00
1 parent f39d843c70
commit 6514b217b9
12 files changed
+465 -127

No files matched your search

@@ -474,9 +474,12 @@ public class GuiNpcManageAbilities extends GuiAbilityInterface
private boolean hasDuplicateName(Ability ability) {
String name = ability.getName();
if (name == null || name.isEmpty()) return false;
String oldName = ability.getId();
// A duplicate exists if the name is already in use and it's not the same ability being edited
return customData.containsKey(name) && !name.equals(oldName);
if (!customData.containsKey(name)) return false;
// Name exists — check if it belongs to a different ability (by UUID)
String uuid = ability.getId();
if (uuid == null || uuid.isEmpty()) return true; // New ability with conflicting name
Ability existing = AbilityController.Instance.getCustomAbilityByName(name);
return existing == null || !uuid.equals(existing.getId());
}
@Override