Encase the PatchouliPages init into a isLoaded check

Allows for testing without Patchouli
This commit is contained in:
Mrbysco 2024-08-11 20:36:25 +02:00
parent 3262554139
commit a20c25eb4a

View file

@ -61,6 +61,7 @@ import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket; import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.neoforged.fml.ModList;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.neoforge.client.event.EntityRenderersEvent; import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent;
@ -109,8 +110,11 @@ public class ActuallyAdditionsClient {
setupRenderLayers(); setupRenderLayers();
if (ModList.get().isLoaded("patchouli")) {
PatchouliPages.init(); PatchouliPages.init();
} }
}
private static void setupRenderLayers() { private static void setupRenderLayers() {
ItemBlockRenderTypes.setRenderLayer(InitFluids.CANOLA_OIL.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(InitFluids.CANOLA_OIL.get(), RenderType.translucent());