From a20c25eb4ac3e19fba1ab5020d77b6d4ea3abb4a Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Sun, 11 Aug 2024 20:36:25 +0200 Subject: [PATCH] Encase the PatchouliPages init into a isLoaded check Allows for testing without Patchouli --- .../actuallyadditions/mod/ActuallyAdditionsClient.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java index a7824a78c..28cb4800f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java @@ -61,6 +61,7 @@ import net.minecraft.client.renderer.item.ItemProperties; import net.minecraft.core.BlockPos; import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket; import net.minecraft.world.phys.BlockHitResult; +import net.neoforged.fml.ModList; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.EntityRenderersEvent; import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; @@ -108,8 +109,11 @@ public class ActuallyAdditionsClient { (stack, level, entity, tintIndex) -> "snail mail".equalsIgnoreCase(stack.getHoverName().getString()) ? 1F : 0F)); setupRenderLayers(); - - PatchouliPages.init(); + + + if (ModList.get().isLoaded("patchouli")) { + PatchouliPages.init(); + } } private static void setupRenderLayers() {