Skip to content

Commit ea7713e

Browse files
committed
move angelica and lwjgl3ify compat checks to ClientProxy
1 parent 95819f1 commit ea7713e

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/main/java/com/falsepattern/falsetweaks/FalseTweaks.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ private static void builtinMod(String modname) {
6666

6767
@Mod.EventHandler
6868
public void preInit(FMLPreInitializationEvent e) {
69-
proxy.preInit(e);
70-
if (Loader.isModLoaded("angelica") && ModuleConfig.THREADED_CHUNK_UPDATES()) {
71-
createSidedException("FalseTweaks threaded rendering is not compatible with Angelica.\nPlease disable it in the FalseTweaks config.");
72-
}
7369
if (Loader.isModLoaded("animfix")) {
7470
builtinMod("animfix");
7571
}
@@ -79,12 +75,7 @@ public void preInit(FMLPreInitializationEvent e) {
7975
if (Loader.isModLoaded("DynamicLights")) {
8076
createSidedException("Remove the DynamicLights mod and restart the game!\nFalseTweaks has built-in dynamic lights support.");
8177
}
82-
if (ModuleConfig.TEXTURE_OPTIMIZATIONS && Compat.isSTBIStitcher()) {
83-
createSidedException("FalseTweaks " +
84-
EnumChatFormatting.BOLD + "textureOptimizations" + EnumChatFormatting.RESET + " is not compatible with LWJGL3Ify's " +
85-
EnumChatFormatting.BOLD + "stbiTextureStitching" + EnumChatFormatting.RESET +
86-
" option.\nDisable stbiTextureStitching in the lwjgl3ify.cfg\nor disable textureOptimizations in FalseTweaks!");
87-
}
78+
proxy.preInit(e);
8879
}
8980

9081
@Mod.EventHandler
@@ -102,7 +93,7 @@ public void loadComplete(FMLLoadCompleteEvent e) {
10293
proxy.loadComplete(e);
10394
}
10495

105-
private static void createSidedException(String text) {
96+
public static void createSidedException(String text) {
10697
if (FMLLaunchHandler.side().isClient()) {
10798
throw ClientHelper.createException(text);
10899
} else {

src/main/java/com/falsepattern/falsetweaks/proxy/ClientProxy.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import net.minecraft.client.Minecraft;
4545
import net.minecraft.client.resources.IReloadableResourceManager;
4646
import net.minecraft.client.settings.GameSettings;
47+
import net.minecraft.util.EnumChatFormatting;
4748
import net.minecraftforge.client.ClientCommandHandler;
4849
import cpw.mods.fml.client.event.ConfigChangedEvent;
4950
import cpw.mods.fml.common.FMLCommonHandler;
@@ -55,13 +56,24 @@
5556
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
5657
import cpw.mods.fml.common.gameevent.TickEvent;
5758

59+
import static com.falsepattern.falsetweaks.FalseTweaks.createSidedException;
60+
5861
@SuppressWarnings("unused")
5962
public class ClientProxy extends CommonProxy {
6063
public static boolean clippingHelperShouldInit = true;
6164

6265
@Override
6366
public void preInit(FMLPreInitializationEvent e) {
6467
super.preInit(e);
68+
if (Loader.isModLoaded("angelica") && ModuleConfig.THREADED_CHUNK_UPDATES()) {
69+
createSidedException("FalseTweaks threaded rendering is not compatible with Angelica.\nPlease disable it in the FalseTweaks config.");
70+
}
71+
if (ModuleConfig.TEXTURE_OPTIMIZATIONS && Compat.isSTBIStitcher()) {
72+
createSidedException("FalseTweaks " +
73+
EnumChatFormatting.BOLD + "textureOptimizations" + EnumChatFormatting.RESET + " is not compatible with LWJGL3Ify's " +
74+
EnumChatFormatting.BOLD + "stbiTextureStitching" + EnumChatFormatting.RESET +
75+
" option.\nDisable stbiTextureStitching in the lwjgl3ify.cfg\nor disable textureOptimizations in FalseTweaks!");
76+
}
6577
FMLCommonHandler.instance().registerCrashCallable(new ICrashCallable() {
6678
@Override
6779
public String getLabel() {

0 commit comments

Comments
 (0)