Fix CraterLib events registration order. Some Events fire before they are registered
This commit is contained in:
@@ -16,10 +16,12 @@ import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
||||
public class ClientRegistration {
|
||||
|
||||
public void registerAll() {
|
||||
Services.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries());
|
||||
}
|
||||
|
||||
public void registerEvents() {
|
||||
CraterEventBus.register(ColorRegistrationEvent.BLOCKS.class, this::registerBlockColors);
|
||||
CraterEventBus.register(ColorRegistrationEvent.ITEMS.class, this::registerItemColors);
|
||||
|
||||
Services.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries());
|
||||
}
|
||||
|
||||
public void registerBlockColors(ColorRegistrationEvent.BLOCKS event) {
|
||||
|
@@ -17,7 +17,10 @@ public class HyperLightingFabricClient implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
new ClientRegistration().registerAll();
|
||||
ClientRegistration registration = new ClientRegistration();
|
||||
registration.registerEvents();
|
||||
registration.registerAll();
|
||||
|
||||
// TODO: Move to CraterLib as an Event
|
||||
ParticleRegistryHandler.registerParticles(new ParticleRegistryHandler.ParticleStrategy() {
|
||||
@Override
|
||||
|
@@ -20,17 +20,19 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
@Mod(Constants.MOD_ID)
|
||||
public class HyperLightingForge {
|
||||
|
||||
private ClientRegistration registration = new ClientRegistration();
|
||||
|
||||
public HyperLightingForge() {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientInit);
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonInit);
|
||||
CommonRegistration.registerAll();
|
||||
|
||||
ForgeWorldGen.registerAll(FMLJavaModLoadingContext.get().getModEventBus());
|
||||
registration.registerEvents();
|
||||
}
|
||||
|
||||
public void clientInit(FMLClientSetupEvent event) {
|
||||
new ClientRegistration().registerAll();
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new CraterConfigScreen(CommonRegistration.config, screen)));
|
||||
registration.registerAll();
|
||||
|
||||
EntityRenderers.register(HLEntities.NEONFLY.get(), NeonFlyRenderer::new);
|
||||
}
|
||||
|
Reference in New Issue
Block a user