Bassebombecraft

Bassebombecraft

18.5k Downloads

1.14.3: Fix registration of projectile

Closed this issue ยท 2 comments

commented

CreativeTabs cannot be resolved to a type
/bassebombecraft-1.8/src/main/java/bassebombecraft/projectile/ProjectileInitializer.java

commented

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

commented

Closed with commit 8e446b8,