From 5e5c328320112794905a96aecdc1bc2656398603 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Mon, 15 Feb 2021 00:33:10 +0800 Subject: Fix filters not applying to modded entries Signed-off-by: shedaniel --- .../rei/RoughlyEnoughItemsInitializer.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'RoughlyEnoughItems-runtime/src/main/java/me/shedaniel') diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java index a7c3832ed..e8f62a527 100644 --- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java +++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsInitializer.java @@ -33,7 +33,7 @@ import net.fabricmc.loader.api.VersionParsingException; import java.lang.reflect.InvocationTargetException; -public class RoughlyEnoughItemsInitializer implements ModInitializer { +public class RoughlyEnoughItemsInitializer implements ModInitializer, ClientModInitializer { @Override public void onInitialize() { checkRequiredFabricModules(); @@ -44,17 +44,18 @@ public class RoughlyEnoughItemsInitializer implements ModInitializer { if (RoughlyEnoughItemsState.getErrors().isEmpty()) { initializeEntryPoint("me.shedaniel.rei.RoughlyEnoughItemsNetwork"); - - if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) { - initializeEntryPoint("me.shedaniel.rei.RoughlyEnoughItemsCore"); - initializeEntryPoint("me.shedaniel.rei.impl.ClientHelperImpl"); - initializeEntryPoint("me.shedaniel.rei.impl.ScreenHelper"); - } } - - if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) { - initializeEntryPoint("me.shedaniel.rei.impl.ErrorDisplayer"); + } + + @Override + public void onInitializeClient() { + if (RoughlyEnoughItemsState.getErrors().isEmpty()) { + initializeEntryPoint("me.shedaniel.rei.RoughlyEnoughItemsCore"); + initializeEntryPoint("me.shedaniel.rei.impl.ClientHelperImpl"); + initializeEntryPoint("me.shedaniel.rei.impl.ScreenHelper"); } + + initializeEntryPoint("me.shedaniel.rei.impl.ErrorDisplayer"); } public void initializeEntryPoint(String className) { -- cgit