mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 19:39:12 +00:00
Revert "Add incompatibles to EnvironmentChecks"
This reverts commit 1b1803c48b.
This commit is contained in:
1 parent
f12a073153
commit
d579d0047f
3 files changed
+13
-135
No files matched your search
@@ -4,7 +4,10 @@ import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
@@ -12,6 +15,7 @@ import cpw.mods.fml.common.TickType;
|
||||
public class TClientTickHandler implements ITickHandler
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
//TControls controlInstance = ((TProxyClient)TConstruct.proxy).controlInstance;
|
||||
|
||||
@Override
|
||||
public void tickEnd (EnumSet<TickType> type, Object... tickData)
|
||||
@@ -19,6 +23,8 @@ public class TClientTickHandler implements ITickHandler
|
||||
TRepo.oreBerry.setGraphicsLevel(Block.leaves.graphicsLevel);
|
||||
TRepo.oreBerrySecond.setGraphicsLevel(Block.leaves.graphicsLevel);
|
||||
TRepo.slimeLeaves.setGraphicsLevel(Block.leaves.graphicsLevel);
|
||||
/*if (mc.thePlayer != null && !mc.thePlayer.isAirBorne)
|
||||
controlInstance.landOnGround();*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ICrashCallable;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import mantle.crash.CallableSuppConfig;
|
||||
import mantle.crash.CallableUnsuppConfig;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import tconstruct.TConstruct;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ICrashCallable;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EnvironmentChecks
|
||||
{
|
||||
@@ -27,19 +22,14 @@ public class EnvironmentChecks
|
||||
* Checks for conflicting stuff in environment; adds callable to any crash logs if so.
|
||||
* Note: This code adds additional data to crashlogs. It does not trigger any crashes.
|
||||
*/
|
||||
private static List<String> incompatibilities = new ArrayList<String>();
|
||||
private static EnvironmentChecks instance = new EnvironmentChecks();
|
||||
|
||||
public static void verifyEnvironmentSanity ()
|
||||
{
|
||||
List<String> modIds = new ArrayList<String>();
|
||||
|
||||
if (Loader.isModLoaded("gregtech_addon"))
|
||||
{
|
||||
TConstruct.logger.severe("Tinkers' Construct and GregTech are incompatible for the following reasons:");
|
||||
TConstruct.logger.severe(modCompatDetails("GregTech", true));
|
||||
TConstruct.logger.severe("[Environment Checks] Gelatinous iceberg dead ahead! Entering Greggy waters! Abandon hope all ye who enter here! (No, seriously, we don't support GT. Don't report any issues. Thanks.)");
|
||||
modIds.add("gregtech_addon");
|
||||
incompatibilities.add("GregTech");
|
||||
}
|
||||
|
||||
// Bukkit/Magic Launcher/Optifine are caught by Mantle, so we no longer check for those.
|
||||
@@ -54,38 +44,6 @@ public class EnvironmentChecks
|
||||
ICrashCallable callable = new CallableUnsuppConfig("TConstruct", modIds);
|
||||
FMLCommonHandler.instance().registerCrashCallable(callable);
|
||||
}
|
||||
|
||||
if (incompatibilities.size() > 0 && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(instance);
|
||||
}
|
||||
}
|
||||
|
||||
public static String modCompatDetails (String type, boolean consoleFormat)
|
||||
{
|
||||
String n = consoleFormat ? System.getProperty("line.separator") : "\n";
|
||||
if (type.equals("GregTech"))
|
||||
{
|
||||
return "- GregTech is an \"IndustrialCraft 2 addon\". People do not expect a total conversion meta-mod that alters every other mod when they install it the first time." + n
|
||||
+ "- The ore dictionary's purpose is interchangable items and mod compatibility. It is not a tool to bend people to your will." + n
|
||||
+ "- GregTech actively breaks mods with \"invalid ore dictionary entries\"." + n
|
||||
+ "- The mod has a blacklist that can corrupt worlds of people on it." + n
|
||||
+ "- The author blames any problems introduced by his mod on others. See \"NotMyFaultException\" for intentional crashes.)";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@ForgeSubscribe
|
||||
public void openMainMenu (GuiOpenEvent event)
|
||||
{
|
||||
if (event.gui instanceof GuiMainMenu)
|
||||
{
|
||||
if (incompatibilities.size() > 0)
|
||||
{
|
||||
event.gui = new EnvironmentGui(event.gui, incompatibilities);
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.unregister(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EnvironmentGui extends GuiScreen
|
||||
{
|
||||
private GuiScreen parentGuiScreen;
|
||||
//private GuiTextField theGuiTextField;
|
||||
private final List<String> mods;
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int count = 0;
|
||||
|
||||
public EnvironmentGui(GuiScreen par1GuiScreen, List<String> modlist)
|
||||
{
|
||||
this.parentGuiScreen = par1GuiScreen;
|
||||
this.mods = modlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui ()
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 175, this.height / 4 + 96 + 24, 350, 20, I18n.getString("I accept responsibility for all bugs and crashes in my modpack.")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 150, this.height / 4 + 120 + 24, 300, 20, I18n.getString("I will remove incompatible mods. (Exits Minecraft)")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the screen is unloaded. Used to disable keyboard repeat events
|
||||
*/
|
||||
public void onGuiClosed ()
|
||||
{
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
protected void actionPerformed (GuiButton button)
|
||||
{
|
||||
if (button.enabled)
|
||||
{
|
||||
if (button.id == 0)
|
||||
{
|
||||
count++;
|
||||
if (count >= mods.size())
|
||||
this.mc.displayGuiScreen(this.parentGuiScreen);
|
||||
}
|
||||
if (button.id == 1)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen (int par1, int par2, float par3)
|
||||
{
|
||||
builder.setLength(0);
|
||||
this.drawDefaultBackground();
|
||||
String mod = mods.get(count);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("Tinkers' Construct and "+mod+" are not compatible"), this.width / 2, 20, 0xFFFFFF);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("The following reasons are given:"), this.width / 2, 32, 0xFFFFFF);
|
||||
fontRenderer.drawSplitString(I18n.getString(EnvironmentChecks.modCompatDetails(mod, false)), 20, 52, 400, 0xffffff);
|
||||
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("Choose one."), this.width / 2, 165, 0xFFFFFF);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user