This commit is contained in:
tterrag1098 committed 2015-09-08 20:36:48 -04:00
commit 5757f17b56
2 files changed
+36 -10

No files matched your search

@@ -356,10 +356,14 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
return new PoweredTask(nextRecipe, chance, getRecipeInputs());
}
protected IPoweredTask createTask(NBTTagCompound taskTagCompound) {
return PoweredTask.readFromNBT(taskTagCompound);
}
@Override
public void readCustomNBT(NBTTagCompound nbtRoot) {
super.readCustomNBT(nbtRoot);
currentTask = PoweredTask.readFromNBT(nbtRoot.getCompoundTag("currentTask"));
currentTask = createTask(nbtRoot.getCompoundTag("currentTask"));
String uid = nbtRoot.getString("lastCompletedRecipe");
lastCompletedRecipe = MachineRecipeRegistry.instance.getRecipeForUid(uid);
}
@@ -14,37 +14,59 @@ import crazypants.enderio.EnderIO;
public class EnderIOCrashCallable implements ICrashCallable {
private static boolean hasOptifine = false;
private static boolean hasUnknownAE2 = false;
private static String hasUnknownAE2 = null;
private static String hasOldAE2 = null;
private static String hasOldRF = null;
public static void create() {
boolean register = false;
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
hasOptifine = FMLClientHandler.instance().hasOptifine();
register = hasOptifine = FMLClientHandler.instance().hasOptifine();
}
for (ModContainer modContainer : ModAPIManager.INSTANCE.getAPIList()) {
if ("appliedenergistics2|API".equals(modContainer.getModId())) {
if (!"rv2".equals(modContainer.getVersion())) {
hasUnknownAE2 = true;
if ("rv1".equals(modContainer.getVersion())) {
hasOldAE2 = modContainer.getVersion() + " from " + modContainer.getSource().getName();
register = true;
} else if (!"rv2".equals(modContainer.getVersion())) {
hasUnknownAE2 = modContainer.getVersion() + " from " + modContainer.getSource().getName();
register = true;
}
} else if ("CoFHAPI|energy".equals(modContainer.getModId())) {
if ("1.7.10R1.0.0".equals(modContainer.getVersion()) || "1.7.10R1.0.1".equals(modContainer.getVersion())) {
hasOldRF = modContainer.getVersion() + " from " + modContainer.getSource().getName();
register = true;
}
}
}
if (hasOptifine || hasUnknownAE2) {
if (register) {
FMLCommonHandler.instance().registerCrashCallable(new EnderIOCrashCallable());
}
}
@Override
public String call() throws Exception {
String msg = "Found the following problems with your installation: ";
String msg = "Found the following problem(s) with your installation: ";
if (hasOptifine) {
msg += "\"Optifine is installed. This is NOT supported.\" ";
}
if (hasUnknownAE2) {
msg += "\"An unknown AE2 API is installed. Ender IO was build against API version rv2.\" ";
if (hasOldRF != null) {
msg += "\"An unsupportted old RF API is installed (" + hasOldRF
+ "). Ender IO needs at least 1.7.10R1.0.2 and will NOT work with older versions.\" ";
}
msg += "This may have caused the error. Try reproducing the crash WITHOUT this/these mods before reporting it.";
if (hasOldAE2 != null) {
msg += "\"An unsupportted old AE2 API is installed (" + hasOldAE2
+ "). Ender IO was build against API version rv2 and will NOT work with older versions.\" ";
}
if (hasUnknownAE2 != null) {
msg += "\"An unknown AE2 API is installed (" + hasUnknownAE2
+ "). Ender IO was build against API version rv2.\" ";
}
msg += "This may have caused the error. Try reproducing the crash WITHOUT this/these mod(s) before reporting it.";
return msg;
}