From 5894c062b8383f8545990df2eef756db014b7a11 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Fri, 21 Jun 2024 20:53:15 +0200 Subject: [PATCH] Fix capabilities being registered too late --- .../IntegratedDynamicsCompat.java | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/cyclops/integrateddynamicscompat/IntegratedDynamicsCompat.java b/src/main/java/org/cyclops/integrateddynamicscompat/IntegratedDynamicsCompat.java index 08c09477..55ef85ad 100644 --- a/src/main/java/org/cyclops/integrateddynamicscompat/IntegratedDynamicsCompat.java +++ b/src/main/java/org/cyclops/integrateddynamicscompat/IntegratedDynamicsCompat.java @@ -2,7 +2,6 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; -import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import org.apache.logging.log4j.Level; import org.cyclops.cyclopscore.config.ConfigHandler; import org.cyclops.cyclopscore.init.ModBaseVersionable; @@ -30,6 +29,13 @@ public class IntegratedDynamicsCompat extends ModBaseVersionable _instance = instance, modEventBus); + + // Capabilities + getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_DRYING_BASIN, new WorkerDryingBasinBlockEntityCompat()); + getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_SQUEEZER, new WorkerSqueezerBlockEntityCompat()); + getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_COAL_GENERATOR, new WorkerCoalGeneratorBlockEntityCompat()); + getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_MECHANICAL_DRYING_BASIN, new WorkerMechanicalMachineBlockEntityCompat<>()); + getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_MECHANICAL_SQUEEZER, new WorkerMechanicalMachineBlockEntityCompat<>()); } @Override @@ -51,18 +57,6 @@ protected void loadModCompats(ModCompatLoader modCompatLoader) { // modCompatLoader.addModCompat(new SignalsModCompat()); } - @Override - protected void setup(FMLCommonSetupEvent event) { - // Capabilities - getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_DRYING_BASIN, new WorkerDryingBasinBlockEntityCompat()); - getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_SQUEEZER, new WorkerSqueezerBlockEntityCompat()); - getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_COAL_GENERATOR, new WorkerCoalGeneratorBlockEntityCompat()); - getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_MECHANICAL_DRYING_BASIN, new WorkerMechanicalMachineBlockEntityCompat<>()); - getCapabilityConstructorRegistry().registerBlockEntity(RegistryEntries.BLOCK_ENTITY_MECHANICAL_SQUEEZER, new WorkerMechanicalMachineBlockEntityCompat<>()); - - super.setup(event); - } - @Override protected IClientProxy constructClientProxy() { return new ClientProxy();