mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 02:59:42 +00:00
Register Item Attribute Controller
This commit is contained in:
1 parent
d41311147c
commit
c3573d5d2c
6 files changed
+46
-26
No files matched your search
@@ -9,8 +9,19 @@ import java.util.Map;
|
||||
* It ensures that keys are unique.
|
||||
*/
|
||||
public class AttributeController {
|
||||
|
||||
public AttributeController Instance;
|
||||
public ModAttributes attributes;
|
||||
|
||||
private static final Map<String, AttributeDefinition> definitions = new HashMap<>();
|
||||
|
||||
public AttributeController(){
|
||||
this.Instance = this;
|
||||
definitions.clear();
|
||||
attributes = new ModAttributes();
|
||||
}
|
||||
|
||||
|
||||
public static AttributeDefinition registerAttribute(String key, String displayName, AttributeValueType valueType) {
|
||||
if (definitions.containsKey(key)) {
|
||||
throw new IllegalArgumentException("Attribute already registered with key: " + key);
|
||||
|
||||
Reference in new issue
Block a user