mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 10:47:30 +00:00
Add another Register
This commit is contained in:
1 parent
93bb6243db
commit
cd487e1122
1 file changed
+9
@@ -41,6 +41,15 @@ public class AttributeController {
|
||||
return def;
|
||||
}
|
||||
|
||||
public static AttributeDefinition registerAttribute(AttributeDefinition definition) {
|
||||
if (definitions.containsKey(definition.getKey())) {
|
||||
throw new IllegalArgumentException("Attribute already registered with key: " + definition.getKey());
|
||||
} else {
|
||||
definitions.put(definition.getKey(), definition);
|
||||
return definition;
|
||||
}
|
||||
}
|
||||
|
||||
public static AttributeDefinition getAttribute(String key) {
|
||||
return definitions.get(key);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user