diff --git a/gradle.properties b/gradle.properties index 193d6180..827adc2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.daemon=false minecraft_version=1.18.2 forge_version=40.1.30 -mod_version=3.19.0 +mod_version=3.19.1 jei_mc_version=1.18.2 jei_version=9.7.0+ curios_version=1.18.2-5.0.6.+ diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/compat/chipped/ChippedCompat.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/compat/chipped/ChippedCompat.java index f8e73c3b..6a981333 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/compat/chipped/ChippedCompat.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/compat/chipped/ChippedCompat.java @@ -11,6 +11,7 @@ import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.DistExecutor; +import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.RegistryObject; import net.p3pp3rf1y.sophisticatedbackpacks.SophisticatedBackpacks; @@ -22,12 +23,15 @@ import net.p3pp3rf1y.sophisticatedcore.client.gui.utils.Position; import net.p3pp3rf1y.sophisticatedcore.common.gui.UpgradeContainerRegistry; import net.p3pp3rf1y.sophisticatedcore.common.gui.UpgradeContainerType; +import net.p3pp3rf1y.sophisticatedcore.compat.CompatModIds; import net.p3pp3rf1y.sophisticatedcore.compat.ICompat; import net.p3pp3rf1y.sophisticatedcore.compat.chipped.BlockTransformationUpgradeContainer; import net.p3pp3rf1y.sophisticatedcore.compat.chipped.BlockTransformationUpgradeItem; import net.p3pp3rf1y.sophisticatedcore.compat.chipped.BlockTransformationUpgradeTab; import net.p3pp3rf1y.sophisticatedcore.compat.chipped.BlockTransformationUpgradeWrapper; +import java.util.function.Supplier; + public class ChippedCompat implements ICompat { public static final RegistryObject BOTANIST_WORKBENCH_UPGRADE = ModItems.ITEMS.register("chipped/botanist_workbench_upgrade", @@ -50,15 +54,17 @@ public void init() { IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); modBus.addGenericListener(MenuType.class, this::registerContainers); - SBPPlugin.setAdditionalCatalystRegistrar(registration -> { - registration.addRecipeCatalyst(new ItemStack(BOTANIST_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "botanist_workbench"), ChippedRecipe.class)); - registration.addRecipeCatalyst(new ItemStack(GLASSBLOWER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "glassblower"), ChippedRecipe.class)); - registration.addRecipeCatalyst(new ItemStack(CARPENTER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "carpenters_table"), ChippedRecipe.class)); - registration.addRecipeCatalyst(new ItemStack(SHEPHERD_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "loom_table"), ChippedRecipe.class)); - registration.addRecipeCatalyst(new ItemStack(MASON_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "mason_table"), ChippedRecipe.class)); - registration.addRecipeCatalyst(new ItemStack(PHILOSOPHER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "alchemy_bench"), ChippedRecipe.class)); - registration.addRecipeCatalyst(new ItemStack(TINKERER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "mechanist_workbench"), ChippedRecipe.class)); - }); + if (ModList.get().isLoaded(CompatModIds.JEI)) { + ((Supplier) () -> () -> SBPPlugin.setAdditionalCatalystRegistrar(registration -> { + registration.addRecipeCatalyst(new ItemStack(BOTANIST_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "botanist_workbench"), ChippedRecipe.class)); + registration.addRecipeCatalyst(new ItemStack(GLASSBLOWER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "glassblower"), ChippedRecipe.class)); + registration.addRecipeCatalyst(new ItemStack(CARPENTER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "carpenters_table"), ChippedRecipe.class)); + registration.addRecipeCatalyst(new ItemStack(SHEPHERD_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "loom_table"), ChippedRecipe.class)); + registration.addRecipeCatalyst(new ItemStack(MASON_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "mason_table"), ChippedRecipe.class)); + registration.addRecipeCatalyst(new ItemStack(PHILOSOPHER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "alchemy_bench"), ChippedRecipe.class)); + registration.addRecipeCatalyst(new ItemStack(TINKERER_WORKBENCH_UPGRADE.get()), new RecipeType<>(new ResourceLocation(Chipped.MOD_ID, "mechanist_workbench"), ChippedRecipe.class)); + })).get().run(); + } } public void registerContainers(RegistryEvent.Register> evt) {