1.14.3: Fix registration of projectile
Closed this issue ยท 2 comments
CreativeTabs cannot be resolved to a type
/bassebombecraft-1.8/src/main/java/bassebombecraft/projectile/ProjectileInitializer.java
Solution:
ProjectileInitializer class is renamed to EntityTypeRegistryEventHandler.
The EntityTypeRegistryEventHandler class is refactored to be invoked using events:
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class EntityTypeRegistryEventHandler {
@SubscribeEvent
public void handleEvent(RegistryEvent.Register<EntityType<?>> event) {
.. the same way it is implemented in the ItemRegistryEventHandler class.
The EntityTypeRegistryEventHandler uses EntityType.Builder to register the projectile:
event.getRegistry().register(EntityType.Builder.<GenericEggProjectile>create(GenericEggProjectile::new, MISC)
.build(PROJECTILE_NAME).setRegistryName(MODID, PROJECTILE_NAME));
Links:
https://www.minecraftforge.net/forum/topic/71717-solved-1142-register-entities-and-rendering/
https://github.com/Aeronica/fourteen/blob/master/src/main/java/net/aeronica/mods/fourteen/Fourteen.java
https://gist.github.com/Cadiboo/b825d62fb46538e7b7b262c5612d62aa
Closed with commit 8e446b8,