diff --git a/src/main/java/com/aetherteam/treasure_reforging/TreasureReforging.java b/src/main/java/com/aetherteam/treasure_reforging/TreasureReforging.java index 5cf3c01..87e3433 100644 --- a/src/main/java/com/aetherteam/treasure_reforging/TreasureReforging.java +++ b/src/main/java/com/aetherteam/treasure_reforging/TreasureReforging.java @@ -5,9 +5,9 @@ import com.aetherteam.treasure_reforging.item.ReforgingItems; import com.aetherteam.treasure_reforging.recipe.TreasureReforgingRecipeSerializers; import com.mojang.logging.LogUtils; +import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; -import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext; import net.neoforged.neoforge.registries.DeferredRegister; import org.slf4j.Logger; @@ -16,9 +16,8 @@ public class TreasureReforging { public static final String MODID = "aether_treasure_reforging"; public static final Logger LOGGER = LogUtils.getLogger(); - public TreasureReforging() { - IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); - modEventBus.addListener(ReforgingData::dataSetup); + public TreasureReforging(IEventBus bus, Dist dist) { + bus.addListener(ReforgingData::dataSetup); DeferredRegister[] registers = { ReforgingBlocks.BLOCKS, @@ -27,7 +26,7 @@ public TreasureReforging() { }; for (DeferredRegister register : registers) { - register.register(modEventBus); + register.register(bus); } } }