mirror of
https://github.com/GTNewHorizons/EnderCore.git
synced 2026-11-21 12:32:15 +00:00
put more distance between the client side exception and the EnderCore
This commit is contained in:
1 parent
a362263d31
commit
596d3c045b
5 files changed
+51
-31
No files matched your search
@@ -64,13 +64,9 @@ public class EnderCore implements IEnderMod {
|
||||
@SneakyThrows
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
if (Loader.isModLoaded("ttCore")) {
|
||||
if (event.getSide().isClient()) {
|
||||
throw new EnderCoreModConflictExceptionClient();
|
||||
} else {
|
||||
throw new RuntimeException(lang.localize("error.ttcore.1") + "\n" + lang.localize("error.ttcore.2") + "\n" + lang.localize("error.ttcore.3"));
|
||||
}
|
||||
proxy.throwModCompatibilityError(lang.localize("error.ttcore.1"), lang.localize("error.ttcore.2"), lang.localize("error.ttcore.3"));
|
||||
}
|
||||
|
||||
|
||||
if (event.getSide().isClient()) {
|
||||
TextureErrorRemover.beginIntercepting();
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.enderio.core;
|
||||
|
||||
import cpw.mods.fml.client.CustomModLoadingErrorDisplayException;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiErrorScreen;
|
||||
|
||||
import static com.enderio.core.EnderCore.lang;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EnderCoreModConflictExceptionClient extends CustomModLoadingErrorDisplayException {
|
||||
|
||||
@Override
|
||||
public void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) {
|
||||
errorScreen.drawCenteredString(fontRenderer, lang.localize("error.ttcore.1"), errorScreen.width / 2, errorScreen.height / 2 - 20, 0xFFFFFF);
|
||||
errorScreen.drawCenteredString(fontRenderer, lang.localize("error.ttcore.2"), errorScreen.width / 2, errorScreen.height / 2 - 10, 0xFFFFFF);
|
||||
errorScreen.drawCenteredString(fontRenderer, lang.localize("error.ttcore.3"), errorScreen.width / 2, errorScreen.height / 2, 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,11 @@ public class ClientProxy extends CommonProxy {
|
||||
public World getClientWorld() {
|
||||
return Minecraft.getMinecraft().theWorld;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void throwModCompatibilityError(String... msgs) {
|
||||
super.throwModCompatibilityError(msgs); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.enderio.core.client;
|
||||
|
||||
import cpw.mods.fml.client.CustomModLoadingErrorDisplayException;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiErrorScreen;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EnderCoreModConflictException extends CustomModLoadingErrorDisplayException {
|
||||
|
||||
private final String[] msgs;
|
||||
|
||||
public EnderCoreModConflictException(String[] msgs) {
|
||||
this.msgs = msgs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) {
|
||||
int y = errorScreen.height / 2 - msgs.length * 5;
|
||||
for(String msg : msgs) {
|
||||
errorScreen.drawCenteredString(fontRenderer, msg, errorScreen.width / 2, y, 0xFFFFFF);
|
||||
y += 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,15 @@ public class CommonProxy {
|
||||
public World getClientWorld() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void throwModCompatibilityError(String ... msgs) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(String msg : msgs) {
|
||||
if(sb.length() > 0) {
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append(msg);
|
||||
}
|
||||
throw new RuntimeException(sb.toString());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user