diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-08-17 21:21:26 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-08-17 21:24:57 -0300 |
commit | 2d0b363fe3179087de59d9ef4a2d14af21d89071 (patch) | |
tree | befdb1f281c3abd82c23d9f6855a3237170e47a5 /src/main/java/ganarchy/chewstuff/ChewComponents.java | |
parent | 731e568ad487b8f7dfbedf22eaca9b12cb3e754d (diff) |
[Project] ChewStuff
Chew Necklaces for Minecraft!
Diffstat (limited to 'src/main/java/ganarchy/chewstuff/ChewComponents.java')
-rw-r--r-- | src/main/java/ganarchy/chewstuff/ChewComponents.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/ganarchy/chewstuff/ChewComponents.java b/src/main/java/ganarchy/chewstuff/ChewComponents.java new file mode 100644 index 0000000..427d86e --- /dev/null +++ b/src/main/java/ganarchy/chewstuff/ChewComponents.java @@ -0,0 +1,28 @@ +package ganarchy.chewstuff; + +import dev.onyxstudios.cca.api.v3.component.ComponentKey; +import dev.onyxstudios.cca.api.v3.component.ComponentRegistry; +import dev.onyxstudios.cca.api.v3.entity.EntityComponentFactoryRegistry; +import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer; +import dev.onyxstudios.cca.api.v3.entity.RespawnCopyStrategy; +import net.minecraft.entity.LivingEntity; +import net.minecraft.util.Identifier; + +public class ChewComponents implements EntityComponentInitializer { + public static final ComponentKey<ChewComponent> CHEW = + ComponentRegistry.getOrCreate( + new Identifier("chewstuff", "chew"), ChewComponent.class + ); + + @Override + public void registerEntityComponentFactories( + EntityComponentFactoryRegistry registry + ) { + registry.registerFor( + LivingEntity.class, CHEW, entity -> new ChewComponent() + ); + registry.registerForPlayers( + CHEW, entity -> new ChewComponent(), RespawnCopyStrategy.ALWAYS_COPY + ); + } +} |