diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index 0345edc9e..493bc3c61 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -104,14 +104,14 @@ public class ActuallyAdditions { ActuallyPOITypes.init(eventBus); ActuallyComponents.init(eventBus); ActuallyLootModifiers.init(eventBus); - ActuallyContainers.CONTAINERS.register(eventBus); + ActuallyContainers.init(eventBus); ArmorMaterials.init(eventBus); InitEntities.init(eventBus); InitFluids.init(eventBus); ActuallyBiomeModifiers.init(eventBus); - eventBus.addListener(this::onConfigReload); ActuallyParticles.init(eventBus); ActuallyTags.init(); + eventBus.addListener(this::onConfigReload); NeoForge.EVENT_BUS.addListener(this::serverStarted); NeoForge.EVENT_BUS.addListener(this::serverStopped); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java index af2bb3748..513960aea 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java @@ -3,13 +3,14 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.inventory.MenuType; +import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.Supplier; public class ActuallyContainers { - public static final DeferredRegister> CONTAINERS = DeferredRegister.create(BuiltInRegistries.MENU, ActuallyAdditions.MODID); + private static final DeferredRegister> CONTAINERS = DeferredRegister.create(BuiltInRegistries.MENU, ActuallyAdditions.MODID); public static final Supplier> SACK_CONTAINER = CONTAINERS.register("sack_container", () -> IMenuTypeExtension.create(SackContainer::fromNetwork)); public static final Supplier> VOID_SACK_CONTAINER = CONTAINERS.register("void_sack_container", () -> IMenuTypeExtension.create(VoidSackContainer::new)); @@ -39,5 +40,9 @@ public class ActuallyContainers { public static final Supplier> RANGED_COLLECTOR_CONTAINER = CONTAINERS.register("ranged_collector_container", () -> IMenuTypeExtension.create(ContainerRangedCollector::fromNetwork)); public static final Supplier> XPSOLIDIFIER_CONTAINER = CONTAINERS.register("xpsolidifier_container", () -> IMenuTypeExtension.create(ContainerXPSolidifier::fromNetwork)); public static final Supplier> ITEM_TAG_CONTAINER = CONTAINERS.register("item_tag_container", () -> IMenuTypeExtension.create(ItemTagContainer::fromNetwork)); + + public static void init(IEventBus evt) { + CONTAINERS.register(evt); + } }