Static Components Feedback
Pyrofab opened this issue ยท 2 comments
#23 added statically declared components as an experimental feature. This issue is for sharing observations and thoughts about that new system.
Annotations
Update: annotations are no more
What is your stance on magical annotations to declare component factories ? Would you rather declare them entirely in fabric.mod.json
?
For example, replacing
{
"custom": {
"cardinal-components-api:component-factories": [
"io.github.mymod.MyComponents"
]
}
}
@EntityComponentFactory(value = "mymod:mycomponent", target = LivingEntity.class)
public static MyComponent create(LivingEntity e /* optional arg */) {
return new MyEntityComponent(e);
}
with
{
"custom": {
"cardinal-components-api:component-factories": [
{
"type": "entity",
"target": "net.minecraft.class_1309",
"factory": "io.github.mymod.MyComponents::create"
}
]
}
}
public static MyComponent create(LivingEntity e /* optional arg */) {
return new MyEntityComponent(e);
}