Register Item Attribute Controller

This commit is contained in:
Kam committed 2025-02-26 12:51:22 -05:00
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);