ofSingleton(T singleton) {
return of((info) -> singleton, singleton.getClass());
}
- static Map> toMap(List> componentProviders) {
- var map = new HashMap>();
+ static Map> toMap(List> componentProviders) {
+ var map = new HashMap>();
componentProviders.forEach(componentProvider -> {
var id = componentProvider.findComponentIdentifier();
- if (map.containsKey(id))
+ if (map.containsKey(id)) {
throw new IllegalArgumentException("Duplicate component: " + id);
+ }
+
map.put(id, componentProvider);
});
return map;
}
@SneakyThrows
- static org.allaymc.api.utils.Identifier findComponentIdentifier(Class> clazz) {
- org.allaymc.api.utils.Identifier identifier = null;
+ static Identifier findComponentIdentifier(Class> clazz) {
+ Identifier identifier = null;
while (identifier == null) {
identifier = findComponentIdentifierInCertainClass(clazz);
if (identifier == null) clazz = clazz.getSuperclass();
@@ -54,11 +56,11 @@ static org.allaymc.api.utils.Identifier findComponentIdentifier(Class> clazz)
}
@SneakyThrows
- static org.allaymc.api.utils.Identifier findComponentIdentifierInCertainClass(Class> clazz) {
+ static Identifier findComponentIdentifierInCertainClass(Class> clazz) {
for (var field : clazz.getDeclaredFields()) {
- if (field.isAnnotationPresent(Identifier.class) && org.allaymc.api.utils.Identifier.class == field.getType() && isStatic(field.getModifiers())) {
+ if (field.isAnnotationPresent(Identifier.Component.class) && Identifier.class == field.getType() && isStatic(field.getModifiers())) {
field.setAccessible(true);
- return (org.allaymc.api.utils.Identifier) field.get(null);
+ return (Identifier) field.get(null);
}
}
return null;
@@ -69,7 +71,7 @@ static org.allaymc.api.utils.Identifier findComponentIdentifierInCertainClass(Cl
Class> getComponentClass();
@SneakyThrows
- default org.allaymc.api.utils.Identifier findComponentIdentifier() {
+ default Identifier findComponentIdentifier() {
return findComponentIdentifier(getComponentClass());
}
diff --git a/server/src/main/java/org/allaymc/server/entity/component/EntityAttributeComponentImpl.java b/server/src/main/java/org/allaymc/server/entity/component/EntityAttributeComponentImpl.java
index 75b9574da..8b869b2a2 100644
--- a/server/src/main/java/org/allaymc/server/entity/component/EntityAttributeComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/entity/component/EntityAttributeComponentImpl.java
@@ -8,8 +8,8 @@
import org.allaymc.api.entity.component.attribute.EntityAttributeComponent;
import org.allaymc.api.eventbus.EventHandler;
import org.allaymc.api.eventbus.event.entity.EntityHealthChangeEvent;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.annotation.ComponentedObject;
-import org.allaymc.server.component.annotation.Identifier;
import org.allaymc.server.component.annotation.Manager;
import org.allaymc.server.entity.component.event.CEntityAttributeChangeEvent;
import org.allaymc.server.entity.component.event.CEntityLoadNBTEvent;
@@ -30,8 +30,8 @@
@Slf4j
public class EntityAttributeComponentImpl implements EntityAttributeComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:entity_attribute_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:entity_attribute_component");
protected final Map attributes = new EnumMap<>(AttributeType.class);
@@ -101,7 +101,7 @@ public Attribute getAttribute(AttributeType attributeType) {
public void setAttributeValue(AttributeType attributeType, float value) {
var attribute = this.attributes.get(attributeType);
if (attribute == null) {
- throw unsupportAttributeTypeException(attributeType);
+ throw unsupportedAttributeTypeException(attributeType);
}
attribute.setCurrentValue(value);
manager.callEvent(CEntityAttributeChangeEvent.INSTANCE);
@@ -111,7 +111,7 @@ public void setAttributeValue(AttributeType attributeType, float value) {
public void setAttribute(Attribute attribute) {
var attributeType = AttributeType.byKey(attribute.getKey());
if (!this.attributes.containsKey(attributeType)) {
- throw unsupportAttributeTypeException(attributeType);
+ throw unsupportedAttributeTypeException(attributeType);
}
this.attributes.put(AttributeType.byKey(attribute.getKey()), attribute);
manager.callEvent(CEntityAttributeChangeEvent.INSTANCE);
@@ -121,7 +121,7 @@ public void setAttribute(Attribute attribute) {
public float getAttributeValue(AttributeType attributeType) {
var attribute = this.getAttribute(attributeType);
if (attribute == null) {
- throw unsupportAttributeTypeException(attributeType);
+ throw unsupportedAttributeTypeException(attributeType);
}
return attribute.getCurrentValue();
}
@@ -131,7 +131,7 @@ public void setHealth(float value) {
if (!supportHealth()) {
// Check if health is supported by the entity here
// To make sure that if health is not supported, event won't be called
- throw unsupportAttributeTypeException(AttributeType.HEALTH);
+ throw unsupportedAttributeTypeException(AttributeType.HEALTH);
}
if (value > 0 && value < 1) {
// Client will think he is dead if the health is less than 1
@@ -149,7 +149,7 @@ public void setHealth(float value) {
setAttributeValue(AttributeType.HEALTH, event.getNewHealth());
}
- protected IllegalArgumentException unsupportAttributeTypeException(AttributeType attributeType) {
+ protected IllegalArgumentException unsupportedAttributeTypeException(AttributeType attributeType) {
return new IllegalArgumentException("Attribute type " + attributeType + " is not found in entity " + thisEntity.getEntityType().getIdentifier());
}
}
diff --git a/server/src/main/java/org/allaymc/server/entity/component/EntityBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/entity/component/EntityBaseComponentImpl.java
index 823442835..518b3894f 100644
--- a/server/src/main/java/org/allaymc/server/entity/component/EntityBaseComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/entity/component/EntityBaseComponentImpl.java
@@ -24,9 +24,13 @@
import org.allaymc.api.permission.DefaultPermissions;
import org.allaymc.api.permission.tree.PermissionTree;
import org.allaymc.api.server.Server;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.api.world.Dimension;
import org.allaymc.api.world.chunk.Chunk;
-import org.allaymc.server.component.annotation.*;
+import org.allaymc.server.component.annotation.ComponentedObject;
+import org.allaymc.server.component.annotation.Dependency;
+import org.allaymc.server.component.annotation.Manager;
+import org.allaymc.server.component.annotation.OnInitFinish;
import org.allaymc.server.entity.component.event.*;
import org.allaymc.server.world.chunk.AllayChunk;
import org.cloudburstmc.math.vector.Vector2f;
@@ -63,8 +67,8 @@
@Slf4j
public class EntityBaseComponentImpl implements EntityBaseComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:entity_base_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:entity_base_component");
public static final int DEFAULT_DEAD_TIMER = 20;
diff --git a/server/src/main/java/org/allaymc/server/entity/component/EntityContainerHolderComponentImpl.java b/server/src/main/java/org/allaymc/server/entity/component/EntityContainerHolderComponentImpl.java
index 4510f4552..99a32e592 100644
--- a/server/src/main/java/org/allaymc/server/entity/component/EntityContainerHolderComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/entity/component/EntityContainerHolderComponentImpl.java
@@ -7,9 +7,9 @@
import org.allaymc.api.entity.component.EntityContainerHolderComponent;
import org.allaymc.api.eventbus.EventHandler;
import org.allaymc.api.item.interfaces.ItemAirStack;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.api.world.gamerule.GameRule;
import org.allaymc.server.component.annotation.ComponentedObject;
-import org.allaymc.server.component.annotation.Identifier;
import org.allaymc.server.entity.component.event.CEntityDieEvent;
import org.jetbrains.annotations.UnmodifiableView;
import org.joml.Vector3f;
@@ -22,8 +22,8 @@
*/
public class EntityContainerHolderComponentImpl extends BaseContainerHolder implements EntityContainerHolderComponent {
- @Identifier
- protected static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:entity_inventory_holder_component");
+ @Identifier.Component
+ protected static final Identifier IDENTIFIER = new Identifier("minecraft:entity_inventory_holder_component");
@ComponentedObject
protected static Entity thisEntity;
diff --git a/server/src/main/java/org/allaymc/server/entity/component/EntityDamageComponentImpl.java b/server/src/main/java/org/allaymc/server/entity/component/EntityDamageComponentImpl.java
index 9edc274c4..000cff97a 100644
--- a/server/src/main/java/org/allaymc/server/entity/component/EntityDamageComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/entity/component/EntityDamageComponentImpl.java
@@ -12,10 +12,10 @@
import org.allaymc.api.eventbus.EventHandler;
import org.allaymc.api.eventbus.event.entity.EntityDamageEvent;
import org.allaymc.api.item.enchantment.type.EnchantmentTypes;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.api.world.gamerule.GameRule;
import org.allaymc.server.component.annotation.ComponentedObject;
import org.allaymc.server.component.annotation.Dependency;
-import org.allaymc.server.component.annotation.Identifier;
import org.allaymc.server.component.annotation.Manager;
import org.allaymc.server.entity.component.event.*;
import org.cloudburstmc.protocol.bedrock.data.entity.EntityEventType;
@@ -25,8 +25,8 @@
* @author daoge_cmd
*/
public class EntityDamageComponentImpl implements EntityDamageComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:entity_damage_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:entity_damage_component");
@Dependency
protected EntityBaseComponent baseComponent;
diff --git a/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerContainerViewerComponentImpl.java b/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerContainerViewerComponentImpl.java
index 3a422ea11..156996901 100644
--- a/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerContainerViewerComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerContainerViewerComponentImpl.java
@@ -13,8 +13,8 @@
import org.allaymc.api.entity.component.player.EntityPlayerBaseComponent;
import org.allaymc.api.entity.component.player.EntityPlayerNetworkComponent;
import org.allaymc.api.math.MathUtils;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.annotation.Dependency;
-import org.allaymc.server.component.annotation.Identifier;
import org.cloudburstmc.math.vector.Vector3i;
import org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType;
import org.cloudburstmc.protocol.bedrock.data.inventory.FullContainerName;
@@ -32,8 +32,8 @@
*/
public class EntityPlayerContainerViewerComponentImpl implements EntityContainerViewerComponent {
- @Identifier
- protected static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:entity_inventory_viewer_component");
+ @Identifier.Component
+ protected static final Identifier IDENTIFIER = new Identifier("minecraft:entity_inventory_viewer_component");
protected byte idCounter = 1;
@Dependency
@@ -167,7 +167,9 @@ public T getOpenedContainer(FullContainerType type) {
}
}
- if (container == null) container = typeToContainer.get(type);
+ if (container == null) {
+ container = typeToContainer.get(type);
+ }
return (T) container;
}
@@ -184,7 +186,9 @@ public T getOpenedContainerBySlotType(ContainerSlotType sl
};
}
- if (fullType == null) fullType = slotTypeToFullType.get(slotType);
+ if (fullType == null) {
+ fullType = slotTypeToFullType.get(slotType);
+ }
return (T) getOpenedContainer(fullType);
}
diff --git a/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerNetworkComponentImpl.java b/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerNetworkComponentImpl.java
index b9531e0ab..dca681b2a 100644
--- a/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerNetworkComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/entity/component/player/EntityPlayerNetworkComponentImpl.java
@@ -23,12 +23,12 @@
import org.allaymc.api.pack.Pack;
import org.allaymc.api.registry.Registries;
import org.allaymc.api.server.Server;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.api.utils.Utils;
import org.allaymc.api.world.Dimension;
import org.allaymc.server.AllayServer;
import org.allaymc.server.component.annotation.ComponentedObject;
import org.allaymc.server.component.annotation.Dependency;
-import org.allaymc.server.component.annotation.Identifier;
import org.allaymc.server.component.annotation.Manager;
import org.allaymc.server.entity.component.event.CPlayerLoggedInEvent;
import org.allaymc.server.network.processor.AllayPacketProcessorHolder;
@@ -53,7 +53,10 @@
import org.joml.Vector3fc;
import javax.crypto.SecretKey;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeMap;
+import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -66,8 +69,8 @@
@Slf4j
public class EntityPlayerNetworkComponentImpl implements EntityPlayerNetworkComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:player_network_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:player_network_component");
protected final Server server = Server.getInstance();
diff --git a/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java b/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java
index e9234b25b..47a62a3b5 100644
--- a/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/item/component/ItemBaseComponentImpl.java
@@ -26,9 +26,13 @@
import org.allaymc.api.item.type.ItemType;
import org.allaymc.api.item.type.ItemTypes;
import org.allaymc.api.math.position.Position3i;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.api.world.Dimension;
import org.allaymc.server.block.type.InternalBlockTypeData;
-import org.allaymc.server.component.annotation.*;
+import org.allaymc.server.component.annotation.ComponentedObject;
+import org.allaymc.server.component.annotation.Dependency;
+import org.allaymc.server.component.annotation.Manager;
+import org.allaymc.server.component.annotation.OnInitFinish;
import org.allaymc.server.item.component.event.*;
import org.allaymc.server.utils.ItemMetaBlockStateBiMap;
import org.cloudburstmc.nbt.NbtMap;
@@ -48,8 +52,8 @@
@Slf4j
public class ItemBaseComponentImpl implements ItemBaseComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:item_base_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:item_base_component");
private static int STACK_NETWORK_ID_COUNTER = 1;
@@ -144,7 +148,7 @@ public NbtMap saveExtraTag() {
nbtBuilder.putList("ench", NbtType.COMPOUND, enchantmentNBT);
}
- //TODO: item lock type
+ // TODO: item lock type
// Custom NBT content
if (!customNBTContent.isEmpty()) nbtBuilder.put("CustomNBT", customNBTContent);
diff --git a/server/src/main/java/org/allaymc/server/item/component/ItemDataComponentImpl.java b/server/src/main/java/org/allaymc/server/item/component/ItemDataComponentImpl.java
index c9054bafe..8e383c5e3 100644
--- a/server/src/main/java/org/allaymc/server/item/component/ItemDataComponentImpl.java
+++ b/server/src/main/java/org/allaymc/server/item/component/ItemDataComponentImpl.java
@@ -4,15 +4,15 @@
import lombok.Getter;
import org.allaymc.api.item.component.data.ItemData;
import org.allaymc.api.item.component.data.ItemDataComponent;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
/**
* @author daoge_cmd
*/
@AllArgsConstructor
public class ItemDataComponentImpl implements ItemDataComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:item_data_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:item_data_component");
protected static final ItemDataComponentImpl DEFAULT = new ItemDataComponentImpl(ItemData.DEFAULT);
diff --git a/server/src/test/java/org/allaymc/server/block/component/TestComponentImpl.java b/server/src/test/java/org/allaymc/server/block/component/TestComponentImpl.java
index 31a6cd960..fd83a6180 100644
--- a/server/src/test/java/org/allaymc/server/block/component/TestComponentImpl.java
+++ b/server/src/test/java/org/allaymc/server/block/component/TestComponentImpl.java
@@ -1,12 +1,12 @@
package org.allaymc.server.block.component;
import org.allaymc.api.block.component.BlockComponent;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
/**
* @author daoge_cmd
*/
public class TestComponentImpl implements TestComponent, BlockComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:test_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:test_component");
}
diff --git a/server/src/test/java/org/allaymc/server/component/ComponentTest.java b/server/src/test/java/org/allaymc/server/component/ComponentTest.java
index b58faef1f..95ff30e0f 100644
--- a/server/src/test/java/org/allaymc/server/component/ComponentTest.java
+++ b/server/src/test/java/org/allaymc/server/component/ComponentTest.java
@@ -3,7 +3,7 @@
import lombok.SneakyThrows;
import org.allaymc.api.component.interfaces.ComponentInitInfo;
import org.allaymc.api.component.interfaces.ComponentedObject;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.impl.*;
import org.allaymc.server.component.injector.AllayComponentInjector;
import org.allaymc.server.component.interfaces.*;
@@ -106,8 +106,8 @@ public void testMethod() {
public static class SimpleNameComponentV2 extends SimpleNameComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:name_component_2");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:name_component_2");
public SimpleNameComponentV2(String name) {
super(name);
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleAttackComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleAttackComponent.java
index f8312fb23..6673d1172 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleAttackComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleAttackComponent.java
@@ -1,7 +1,7 @@
package org.allaymc.server.component.impl;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.annotation.Dependency;
-import org.allaymc.server.component.annotation.Identifier;
import org.allaymc.server.component.interfaces.AttackComponent;
import org.allaymc.server.component.interfaces.HealthComponent;
@@ -9,8 +9,8 @@
* @author daoge_cmd
*/
public class SimpleAttackComponent implements AttackComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:attack_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:attack_component");
@Dependency
protected HealthComponent healthComponent;
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleHealthComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleHealthComponent.java
index 05cea07e1..b1ae13fa6 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleHealthComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleHealthComponent.java
@@ -1,14 +1,14 @@
package org.allaymc.server.component.impl;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.interfaces.HealthComponent;
/**
* @author daoge_cmd
*/
public class SimpleHealthComponent implements HealthComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:health_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:health_component");
protected final int maxHealth;
protected int health;
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleNameComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleNameComponent.java
index b4a5f1be3..1a209dd29 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleNameComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleNameComponent.java
@@ -1,14 +1,14 @@
package org.allaymc.server.component.impl;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.interfaces.NameComponent;
/**
* @author daoge_cmd
*/
public class SimpleNameComponent implements NameComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:name_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:name_component");
protected String name;
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestAnonymousClassComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestAnonymousClassComponent.java
index a517c54d0..381f665a9 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestAnonymousClassComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestAnonymousClassComponent.java
@@ -1,12 +1,12 @@
package org.allaymc.server.component.impl;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.interfaces.TestAnonymousClassComponent;
/**
* @author daoge_cmd
*/
public class SimpleTestAnonymousClassComponent implements TestAnonymousClassComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:test_anonymous_class_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:test_anonymous_class_component");
}
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestDependencyComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestDependencyComponent.java
index 81752d418..6e9729e65 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestDependencyComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestDependencyComponent.java
@@ -1,16 +1,16 @@
package org.allaymc.server.component.impl;
import org.allaymc.api.component.interfaces.Component;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.annotation.Dependency;
-import org.allaymc.server.component.annotation.Identifier;
import org.allaymc.server.component.interfaces.TestDependencyComponent;
/**
* @author daoge_cmd
*/
public class SimpleTestDependencyComponent implements TestDependencyComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:test_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:test_component");
@Dependency(identifier = "minecraft:name_component")
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventListenerComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventListenerComponent.java
index 0fbb178f6..7a7d4eb56 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventListenerComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventListenerComponent.java
@@ -1,7 +1,7 @@
package org.allaymc.server.component.impl;
import org.allaymc.api.eventbus.EventHandler;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.event.TestEvent;
import org.allaymc.server.component.interfaces.TestEventListenerComponent;
@@ -9,8 +9,8 @@
* @author daoge_cmd
*/
public class SimpleTestEventListenerComponent implements TestEventListenerComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:test_event_listener_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:test_event_listener_component");
@EventHandler
protected void testListener(TestEvent event) {
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventTriggerComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventTriggerComponent.java
index c8453d35a..bc49643ac 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventTriggerComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestEventTriggerComponent.java
@@ -1,7 +1,7 @@
package org.allaymc.server.component.impl;
import org.allaymc.api.component.interfaces.ComponentManager;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.annotation.Manager;
import org.allaymc.server.component.event.TestEvent;
import org.allaymc.server.component.interfaces.TestEventTriggerComponent;
@@ -10,8 +10,8 @@
* @author daoge_cmd
*/
public class SimpleTestEventTriggerComponent implements TestEventTriggerComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:test_event_trigger_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:test_event_trigger_component");
@Manager
protected ComponentManager manager;
diff --git a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestInitArgComponent.java b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestInitArgComponent.java
index eb3414c91..66f21486f 100644
--- a/server/src/test/java/org/allaymc/server/component/impl/SimpleTestInitArgComponent.java
+++ b/server/src/test/java/org/allaymc/server/component/impl/SimpleTestInitArgComponent.java
@@ -1,14 +1,14 @@
package org.allaymc.server.component.impl;
-import org.allaymc.server.component.annotation.Identifier;
+import org.allaymc.api.utils.Identifier;
import org.allaymc.server.component.interfaces.TestInitArgComponent;
/**
* @author daoge_cmd
*/
public class SimpleTestInitArgComponent implements TestInitArgComponent {
- @Identifier
- public static final org.allaymc.api.utils.Identifier IDENTIFIER = new org.allaymc.api.utils.Identifier("minecraft:test_init_arg_component");
+ @Identifier.Component
+ public static final Identifier IDENTIFIER = new Identifier("minecraft:test_init_arg_component");
protected final int data;