Condition Registry [1/2]

This commit is contained in:
Kam committed 2026-02-21 02:36:41 -05:00
1 parent 8648e019a9
commit 606bc093df
4 files changed
+232 -48

No files matched your search

@@ -903,6 +903,28 @@ public class AbilityController implements IAbilityHandler {
return conditionTypes.keySet().toArray(new String[0]);
}
public List<String> getConditionNamespaces() {
LinkedHashSet<String> seen = new LinkedHashSet<>();
for (String typeId : conditionTypes.keySet()) {
String[] parts = typeId.split("\\.", 3);
if (parts.length >= 2) {
seen.add(parts[1]);
}
}
return new ArrayList<>(seen);
}
public String[] getConditionTypesByNamespace(String namespace) {
String prefix = "condition." + namespace + ".";
List<String> result = new ArrayList<>();
for (String typeId : conditionTypes.keySet()) {
if (typeId.startsWith(prefix)) {
result.add(typeId);
}
}
return result.toArray(new String[0]);
}
public void registerFlightChecker(Predicate<EntityPlayer> checker) {
flightCheckers.add(checker);
}