mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 20:25:13 +00:00
Condition Registry [1/2]
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user