TryCatch changes

This commit is contained in:
Muramasa 2016-08-13 10:10:11 +01:00
parent 0345ada52c
commit 009709462e
13 changed files with 632 additions and 701 deletions

View file

@ -58,8 +58,7 @@ import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
@Mod(modid = "gregtech", name = "GregTech", version = "MC1710", useMetadata = false, dependencies = "required-after:IC2; after:Forestry; after:PFAAGeologica; after:Thaumcraft; after:Railcraft; after:appliedenergistics2; after:ThermalExpansion; after:TwilightForest; after:harvestcraft; after:magicalcrops; after:BuildCraft|Transport; after:BuildCraft|Silicon; after:BuildCraft|Factory; after:BuildCraft|Energy; after:BuildCraft|Core; after:BuildCraft|Builders; after:GalacticraftCore; after:GalacticraftMars; after:GalacticraftPlanets; after:ThermalExpansion|Transport; after:ThermalExpansion|Energy; after:ThermalExpansion|Factory; after:RedPowerCore; after:RedPowerBase; after:RedPowerMachine; after:RedPowerCompat; after:RedPowerWiring; after:RedPowerLogic; after:RedPowerLighting; after:RedPowerWorld; after:RedPowerControl; after:UndergroundBiomes;") @Mod(modid = "gregtech", name = "GregTech", version = "MC1710", useMetadata = false, dependencies = "required-after:IC2; after:Forestry; after:PFAAGeologica; after:Thaumcraft; after:Railcraft; after:appliedenergistics2; after:ThermalExpansion; after:TwilightForest; after:harvestcraft; after:magicalcrops; after:BuildCraft|Transport; after:BuildCraft|Silicon; after:BuildCraft|Factory; after:BuildCraft|Energy; after:BuildCraft|Core; after:BuildCraft|Builders; after:GalacticraftCore; after:GalacticraftMars; after:GalacticraftPlanets; after:ThermalExpansion|Transport; after:ThermalExpansion|Energy; after:ThermalExpansion|Factory; after:RedPowerCore; after:RedPowerBase; after:RedPowerMachine; after:RedPowerCompat; after:RedPowerWiring; after:RedPowerLogic; after:RedPowerLighting; after:RedPowerWorld; after:RedPowerControl; after:UndergroundBiomes;")
public class GT_Mod public class GT_Mod implements IGT_Mod {
implements IGT_Mod {
public static final int VERSION = 509; public static final int VERSION = 509;
public static final int REQUIRED_IC2 = 624; public static final int REQUIRED_IC2 = 624;
@Mod.Instance("gregtech") @Mod.Instance("gregtech")
@ -104,13 +103,11 @@ public class GT_Mod
if (GregTech_API.sPreloadStarted) { if (GregTech_API.sPreloadStarted) {
return; return;
} }
for (Runnable tRunnable : GregTech_API.sBeforeGTPreload) {
try { try {
for (Runnable tRunnable : GregTech_API.sBeforeGTPreload) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
File tFile = new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg"); File tFile = new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg");
Configuration tMainConfig = new Configuration(tFile); Configuration tMainConfig = new Configuration(tFile);
tMainConfig.load(); tMainConfig.load();
@ -367,13 +364,11 @@ public class GT_Mod
GregTech_API.sPreloadFinished = true; GregTech_API.sPreloadFinished = true;
GT_Log.out.println("GT_Mod: Preload-Phase finished!"); GT_Log.out.println("GT_Mod: Preload-Phase finished!");
GT_Log.ore.println("GT_Mod: Preload-Phase finished!"); GT_Log.ore.println("GT_Mod: Preload-Phase finished!");
for (Runnable tRunnable : GregTech_API.sAfterGTPreload) {
try { try {
for (Runnable tRunnable : GregTech_API.sAfterGTPreload) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
@Mod.EventHandler @Mod.EventHandler
@ -381,13 +376,11 @@ public class GT_Mod
if (GregTech_API.sLoadStarted) { if (GregTech_API.sLoadStarted) {
return; return;
} }
for (Runnable tRunnable : GregTech_API.sBeforeGTLoad) {
try { try {
for (Runnable tRunnable : GregTech_API.sBeforeGTLoad) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
new GT_Bees(); new GT_Bees();
@ -400,13 +393,11 @@ public class GT_Mod
GregTech_API.sLoadFinished = true; GregTech_API.sLoadFinished = true;
GT_Log.out.println("GT_Mod: Load-Phase finished!"); GT_Log.out.println("GT_Mod: Load-Phase finished!");
GT_Log.ore.println("GT_Mod: Load-Phase finished!"); GT_Log.ore.println("GT_Mod: Load-Phase finished!");
for (Runnable tRunnable : GregTech_API.sAfterGTLoad) {
try { try {
for (Runnable tRunnable : GregTech_API.sAfterGTLoad) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
@Mod.EventHandler @Mod.EventHandler
@ -414,13 +405,11 @@ public class GT_Mod
if (GregTech_API.sPostloadStarted) { if (GregTech_API.sPostloadStarted) {
return; return;
} }
for (Runnable tRunnable : GregTech_API.sBeforeGTPostload) {
try { try {
for (Runnable tRunnable : GregTech_API.sBeforeGTPostload) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
gregtechproxy.onPostLoad(); gregtechproxy.onPostLoad();
if (gregtechproxy.mSortToTheEnd) { if (gregtechproxy.mSortToTheEnd) {
gregtechproxy.registerUnificationEntries(); gregtechproxy.registerUnificationEntries();
@ -605,13 +594,11 @@ public class GT_Mod
GregTech_API.sPostloadFinished = true; GregTech_API.sPostloadFinished = true;
GT_Log.out.println("GT_Mod: PostLoad-Phase finished!"); GT_Log.out.println("GT_Mod: PostLoad-Phase finished!");
GT_Log.ore.println("GT_Mod: PostLoad-Phase finished!"); GT_Log.ore.println("GT_Mod: PostLoad-Phase finished!");
for (Runnable tRunnable : GregTech_API.sAfterGTPostload) {
try { try {
for (Runnable tRunnable : GregTech_API.sAfterGTPostload) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Adding Fake Recipes for NEI"); GT_Log.out.println("GT_Mod: Adding Fake Recipes for NEI");
if (ItemList.FR_Bee_Drone.get(1L, new Object[0]) != null) { if (ItemList.FR_Bee_Drone.get(1L, new Object[0]) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Drone.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Drone.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0);
@ -700,13 +687,11 @@ public class GT_Mod
@Mod.EventHandler @Mod.EventHandler
public void onServerStarting(FMLServerStartingEvent aEvent) { public void onServerStarting(FMLServerStartingEvent aEvent) {
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) {
try { try {
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
gregtechproxy.onServerStarting(); gregtechproxy.onServerStarting();
GT_Log.out.println("GT_Mod: Unificating outputs of all known Recipe Types."); GT_Log.out.println("GT_Mod: Unificating outputs of all known Recipe Types.");
ArrayList<ItemStack> tStacks = new ArrayList(10000); ArrayList<ItemStack> tStacks = new ArrayList(10000);
@ -840,13 +825,11 @@ public class GT_Mod
GregTech_API.mServerStarted = true; GregTech_API.mServerStarted = true;
GT_Log.out.println("GT_Mod: ServerStarting-Phase finished!"); GT_Log.out.println("GT_Mod: ServerStarting-Phase finished!");
GT_Log.ore.println("GT_Mod: ServerStarting-Phase finished!"); GT_Log.ore.println("GT_Mod: ServerStarting-Phase finished!");
for (Runnable tRunnable : GregTech_API.sAfterGTServerstart) {
try { try {
for (Runnable tRunnable : GregTech_API.sAfterGTServerstart) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
@Mod.EventHandler @Mod.EventHandler
@ -858,14 +841,12 @@ public class GT_Mod
public void onIDChangingEvent(FMLModIdMappingEvent aEvent) { public void onIDChangingEvent(FMLModIdMappingEvent aEvent) {
GT_Utility.reInit(); GT_Utility.reInit();
GT_Recipe.reInit(); GT_Recipe.reInit();
try {
for (Iterator i$ = GregTech_API.sItemStackMappings.iterator(); i$.hasNext(); ) { for (Iterator i$ = GregTech_API.sItemStackMappings.iterator(); i$.hasNext(); ) {
Map tMap = (Map) i$.next(); Map tMap = (Map) i$.next();
try {
GT_Utility.reMap(tMap); GT_Utility.reMap(tMap);
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
// public void onIDChangingEvent(FMLModIdMappingEvent aEvent) // public void onIDChangingEvent(FMLModIdMappingEvent aEvent)
@ -880,13 +861,11 @@ public class GT_Mod
@Mod.EventHandler @Mod.EventHandler
public void onServerStopping(FMLServerStoppingEvent aEvent) { public void onServerStopping(FMLServerStoppingEvent aEvent) {
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstop) {
try { try {
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstop) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
gregtechproxy.onServerStopping(); gregtechproxy.onServerStopping();
try { try {
if ((GT_Values.D1) || (GT_Log.out != System.out)) { if ((GT_Values.D1) || (GT_Log.out != System.out)) {
@ -954,13 +933,11 @@ public class GT_Mod
e.printStackTrace(GT_Log.err); e.printStackTrace(GT_Log.err);
} }
} }
for (Runnable tRunnable : GregTech_API.sAfterGTServerstop) {
try { try {
for (Runnable tRunnable : GregTech_API.sAfterGTServerstop) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
public boolean isServerSide() { public boolean isServerSide() {

View file

@ -120,8 +120,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
use(aStack, 0, aPlayer); use(aStack, 0, aPlayer);
isItemStackUsable(aStack); isItemStackUsable(aStack);
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
try {
if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) { if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
return true; return true;
@ -141,8 +140,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
use(aStack, 0, aPlayer); use(aStack, 0, aPlayer);
isItemStackUsable(aStack); isItemStackUsable(aStack);
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
try {
if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) { if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
return true; return true;
@ -162,8 +160,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
use(aStack, 0, aPlayer); use(aStack, 0, aPlayer);
isItemStackUsable(aStack); isItemStackUsable(aStack);
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
try {
if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) { if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem(); if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
return true; return true;
@ -183,8 +180,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
use(aStack, 0, aPlayer); use(aStack, 0, aPlayer);
isItemStackUsable(aStack); isItemStackUsable(aStack);
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack)); ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
try {
aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer); aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
} catch (Throwable e) { } catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err); if (D1) e.printStackTrace(GT_Log.err);

View file

@ -180,8 +180,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
long tTime = System.currentTimeMillis(); long tTime = System.currentTimeMillis();
for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
try {
switch (tCode) { switch (tCode) {
case 0: case 0:
tCode++; tCode++;
@ -286,11 +285,10 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
tCode = -1; tCode = -1;
break; break;
} }
} catch (Throwable e) { }} catch (Throwable e) {
GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
e.printStackTrace(GT_Log.err); e.printStackTrace(GT_Log.err);
} }
}
if (isServerSide() && hasValidMetaTileEntity()) { if (isServerSide() && hasValidMetaTileEntity()) {
tTime = System.currentTimeMillis() - tTime; tTime = System.currentTimeMillis() - tTime;
@ -706,7 +704,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
} }
@Override @Override
public ITexture[] getTexture(Block aBlock, byte aSide) { public ITexture[] getTexture(byte aSide) {
ITexture rIcon = getCoverTexture(aSide); ITexture rIcon = getCoverTexture(aSide);
if (rIcon != null) return new ITexture[]{rIcon}; if (rIcon != null) return new ITexture[]{rIcon};
return getTextureUncovered(aSide); return getTextureUncovered(aSide);

View file

@ -251,8 +251,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
mRunningThroughTick = true; mRunningThroughTick = true;
long tTime = System.currentTimeMillis(); long tTime = System.currentTimeMillis();
for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
try {
switch (tCode) { switch (tCode) {
case 0: case 0:
tCode++; tCode++;
@ -448,12 +447,6 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) { if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) {
dischargeItem(mMetaTileEntity.mInventory[i]); dischargeItem(mMetaTileEntity.mInventory[i]);
if(ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i])>0){
if((getStoredEU() + ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]))<getEUCapacity()){
increaseStoredEnergyUnits((long)ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]),false);
mMetaTileEntity.mInventory[i].stackSize--;
}
}
if (mMetaTileEntity.mInventory[i].stackSize <= 0) if (mMetaTileEntity.mInventory[i].stackSize <= 0)
mMetaTileEntity.mInventory[i] = null; mMetaTileEntity.mInventory[i] = null;
mInventoryChanged = true; mInventoryChanged = true;
@ -529,12 +522,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
default: default:
tCode = -1; tCode = -1;
break; break;
} }}
} catch (Throwable e) { } catch (Throwable e) {
GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); //gregtech.api.util.GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
e.printStackTrace(GT_Log.err); e.printStackTrace(GT_Log.err);
} }
}
if (isServerSide() && hasValidMetaTileEntity()) { if (isServerSide() && hasValidMetaTileEntity()) {
tTime = System.currentTimeMillis() - tTime; tTime = System.currentTimeMillis() - tTime;

View file

@ -30,27 +30,23 @@ public class GT_FluidStack extends FluidStack {
} }
public static final synchronized void fixAllThoseFuckingFluidIDs() { public static final synchronized void fixAllThoseFuckingFluidIDs() {
if (ForgeVersion.getBuildVersion() < 1355) { if (ForgeVersion.getBuildVersion() < 1355 && ForgeVersion.getRevisionVersion() < 4) {
while (lock) {
try { try {
while (lock) {
Thread.sleep(1); Thread.sleep(1);
} catch (InterruptedException e) { }} catch (InterruptedException e) {}
}
}
lock = true; lock = true;
for (GT_FluidStack tFluid : sAllFluidStacks) tFluid.fixFluidIDForFucksSake(); for (GT_FluidStack tFluid : sAllFluidStacks) tFluid.fixFluidIDForFucksSake();
for (Map<Fluid, ?> tMap : GregTech_API.sFluidMappings)
try { try {
for (Map<Fluid, ?> tMap : GregTech_API.sFluidMappings)
GT_Utility.reMap(tMap); GT_Utility.reMap(tMap);
} catch (Throwable e) { } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
e.printStackTrace(GT_Log.err);
}
lock = false; lock = false;
} }
} }
public final void fixFluidIDForFucksSake() { public final void fixFluidIDForFucksSake() {
if (ForgeVersion.getBuildVersion() < 1355) { if (ForgeVersion.getBuildVersion() < 1355 && ForgeVersion.getRevisionVersion() < 4) {
int fluidID; int fluidID;
try { try {
fluidID = this.getFluid().getID(); fluidID = this.getFluid().getID();
@ -67,7 +63,7 @@ public class GT_FluidStack extends FluidStack {
@Override @Override
public FluidStack copy() { public FluidStack copy() {
if (ForgeVersion.getBuildVersion() < 1355) { if (ForgeVersion.getBuildVersion() < 1355 && ForgeVersion.getRevisionVersion() < 4) {
fixFluidIDForFucksSake(); fixFluidIDForFucksSake();
} }
return new GT_FluidStack(this); return new GT_FluidStack(this);

View file

@ -1993,16 +1993,14 @@ public class GT_Utility {
if (aStack != null) { if (aStack != null) {
NBTTagList nbttaglist = aStack.getEnchantmentTagList(); NBTTagList nbttaglist = aStack.getEnchantmentTagList();
if (nbttaglist != null) { if (nbttaglist != null) {
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
try { try {
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); short short1 = nbttaglist.getCompoundTagAt(i).getShort("id");
short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl");
if (Enchantment.enchantmentsList[short1] != null) if (Enchantment.enchantmentsList[short1] != null)
aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2); aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2);
} catch (Throwable e) {
//
}
} }
} catch (Throwable e) {/**/}
} }
} }
} }

View file

@ -204,9 +204,9 @@ public class GT_Client extends GT_Proxy
public void onPostLoad() { public void onPostLoad() {
super.onPostLoad(); super.onPostLoad();
try {
label0: label0:
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++)
try {
do { do {
if (i >= GregTech_API.METATILEENTITIES.length) if (i >= GregTech_API.METATILEENTITIES.length)
continue label0; continue label0;
@ -214,9 +214,7 @@ public class GT_Client extends GT_Proxy
GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true); GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
i++; i++;
} while (true); } while (true);
} catch (Throwable e) { } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
e.printStackTrace(GT_Log.err);
}
// super.onPostLoad(); // super.onPostLoad();

View file

@ -483,17 +483,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
} }
} }
GT_Log.out.println("GT_Mod: Adding Configs specific for MetaTileEntities"); GT_Log.out.println("GT_Mod: Adding Configs specific for MetaTileEntities");
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
try { try {
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
for (; i < GregTech_API.METATILEENTITIES.length; i++) { for (; i < GregTech_API.METATILEENTITIES.length; i++) {
if (GregTech_API.METATILEENTITIES[i] != null) { if (GregTech_API.METATILEENTITIES[i] != null) {
GregTech_API.METATILEENTITIES[i].onConfigLoad(GregTech_API.sMachineFile); GregTech_API.METATILEENTITIES[i].onConfigLoad(GregTech_API.sMachineFile);
} }
} }
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Adding Tool Usage Crafting Recipes for OreDict Items."); GT_Log.out.println("GT_Mod: Adding Tool Usage Crafting Recipes for OreDict Items.");
long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED
| GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE; | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE;
@ -740,17 +738,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
break; break;
} }
} }
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
try { try {
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
for (; i < GregTech_API.METATILEENTITIES.length; i++) { for (; i < GregTech_API.METATILEENTITIES.length; i++) {
if (GregTech_API.METATILEENTITIES[i] != null) { if (GregTech_API.METATILEENTITIES[i] != null) {
GregTech_API.METATILEENTITIES[i].onServerStart(); GregTech_API.METATILEENTITIES[i].onServerStart();
} }
} }
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
public void onServerStarted() { public void onServerStarted() {
@ -782,17 +778,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
File tSaveDirectory = getSaveDirectory(); File tSaveDirectory = getSaveDirectory();
GregTech_API.sWirelessRedstone.clear(); GregTech_API.sWirelessRedstone.clear();
if (tSaveDirectory != null) { if (tSaveDirectory != null) {
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
try { try {
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
for (; i < GregTech_API.METATILEENTITIES.length; i++) { for (; i < GregTech_API.METATILEENTITIES.length; i++) {
if (GregTech_API.METATILEENTITIES[i] != null) { if (GregTech_API.METATILEENTITIES[i] != null) {
GregTech_API.METATILEENTITIES[i].onWorldSave(tSaveDirectory); GregTech_API.METATILEENTITIES[i].onWorldSave(tSaveDirectory);
} }
} }
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
this.mUniverse = null; this.mUniverse = null;
} }
@ -1413,15 +1407,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
File tSaveDiretory = getSaveDirectory(); File tSaveDiretory = getSaveDirectory();
if (tSaveDiretory != null) { if (tSaveDiretory != null) {
this.isFirstServerWorldTick = false; this.isFirstServerWorldTick = false;
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
try { try {
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
if (tMetaTileEntity != null) { if (tMetaTileEntity != null) {
tMetaTileEntity.onWorldLoad(tSaveDiretory); tMetaTileEntity.onWorldLoad(tSaveDiretory);
} }
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} }
} }
if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) { if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) {

View file

@ -112,13 +112,11 @@ public class GT_Worldgenerator
if (tBiome == null) { if (tBiome == null) {
tBiome = BiomeGenBase.plains.biomeName; tBiome = BiomeGenBase.plains.biomeName;
} }
for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) {
try { try {
for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) {
tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, tX, tZ, this.mChunkGenerator, this.mChunkProvider); tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, tX, tZ, this.mChunkGenerator, this.mChunkProvider);
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
j++; j++;
} }
i++; i++;

View file

@ -212,15 +212,13 @@ public class GT_Block_Machines
GregTech_API.sBlockIcons = aIconRegister; GregTech_API.sBlockIcons = aIconRegister;
GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures"); GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures");
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
try { try {
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
if (tMetaTileEntity != null) { if (tMetaTileEntity != null) {
tMetaTileEntity.registerIcons(aIconRegister); tMetaTileEntity.registerIcons(aIconRegister);
} }
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Registering Crop specific Textures"); GT_Log.out.println("GT_Mod: Registering Crop specific Textures");
try { try {
for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) { for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) {
@ -231,13 +229,11 @@ public class GT_Block_Machines
} }
GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase"); GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase");
System.out.println("GT_Mod: Starting Block Icon Load Phase"); System.out.println("GT_Mod: Starting Block Icon Load Phase");
for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
try { try {
for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase"); GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase");
System.out.println("GT_Mod: Finished Block Icon Load Phase"); System.out.println("GT_Mod: Finished Block Icon Load Phase");
} }

View file

@ -98,13 +98,11 @@ public class GT_IntegratedCircuit_Item
GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase"); GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase");
System.out.println("GT_Mod: Starting Item Icon Load Phase"); System.out.println("GT_Mod: Starting Item Icon Load Phase");
GregTech_API.sItemIcons = aIconRegister; GregTech_API.sItemIcons = aIconRegister;
for (Runnable tRunnable : GregTech_API.sGTItemIconload) {
try { try {
for (Runnable tRunnable : GregTech_API.sGTItemIconload) {
tRunnable.run(); tRunnable.run();
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
GT_Log.out.println("GT_Mod: Finished Item Icon Load Phase"); GT_Log.out.println("GT_Mod: Finished Item Icon Load Phase");
System.out.println("GT_Mod: Finished Item Icon Load Phase"); System.out.println("GT_Mod: Finished Item Icon Load Phase");
} }

View file

@ -94,7 +94,7 @@ public class Behaviour_DataOrb
} }
public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
if (!getDataTitle(aStack).equals("")) { if (!(getDataTitle(aStack).length() == 0)) {
aList.add(getDataTitle(aStack)); aList.add(getDataTitle(aStack));
aList.add(getDataName(aStack)); aList.add(getDataName(aStack));
} }

View file

@ -54,6 +54,7 @@ public class GT_ItemIterator
GT_Log.out.println("GT_Mod: Scanning ItemList."); GT_Log.out.println("GT_Mod: Scanning ItemList.");
try {
Iterator tIterator = Item.itemRegistry.iterator(); Iterator tIterator = Item.itemRegistry.iterator();
while (tIterator.hasNext()) { while (tIterator.hasNext()) {
Object tObject; Object tObject;
@ -61,7 +62,6 @@ public class GT_ItemIterator
Item tItem = (Item) tObject; Item tItem = (Item) tObject;
String tName; String tName;
if ((tName = tItem.getUnlocalizedName()) != null) { if ((tName = tItem.getUnlocalizedName()) != null) {
try {
if ((tItem instanceof IToolCrowbar)) { if ((tItem instanceof IToolCrowbar)) {
if ((!tItem.isDamageable()) && (!GT_ModHandler.isElectricItem(new ItemStack(tItem, 1, 0)))) { if ((!tItem.isDamageable()) && (!GT_ModHandler.isElectricItem(new ItemStack(tItem, 1, 0)))) {
if ((GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "infiniteDurabilityRCCrowbars", false)) && if ((GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "infiniteDurabilityRCCrowbars", false)) &&
@ -72,9 +72,6 @@ public class GT_ItemIterator
GT_Log.out.println("GT_Mod: Registered valid RC Crowbar: " + tName); GT_Log.out.println("GT_Mod: Registered valid RC Crowbar: " + tName);
} }
} }
} catch (Throwable e) {
}
try {
if ((tItem instanceof IToolWrench)) { if ((tItem instanceof IToolWrench)) {
if ((!tItem.isDamageable()) && (!GT_ModHandler.isElectricItem(new ItemStack(tItem, 1, 0)))) { if ((!tItem.isDamageable()) && (!GT_ModHandler.isElectricItem(new ItemStack(tItem, 1, 0)))) {
if ((GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "infiniteDurabilityBCWrenches", false)) && if ((GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "infiniteDurabilityBCWrenches", false)) &&
@ -85,8 +82,6 @@ public class GT_ItemIterator
GT_Log.out.println("GT_Mod: Registered valid BC Wrench: " + tName); GT_Log.out.println("GT_Mod: Registered valid BC Wrench: " + tName);
} }
} }
} catch (Throwable e) {
}
Block tBlock = GT_Utility.getBlockFromStack(new ItemStack(tItem, 1, 0)); Block tBlock = GT_Utility.getBlockFromStack(new ItemStack(tItem, 1, 0));
if (tBlock != null) { if (tBlock != null) {
if (tName.endsWith("beehives")) { if (tName.endsWith("beehives")) {
@ -94,13 +89,9 @@ public class GT_ItemIterator
gregtech.common.tools.GT_Tool_Scoop.sBeeHiveMaterial = tBlock.getMaterial(); gregtech.common.tools.GT_Tool_Scoop.sBeeHiveMaterial = tBlock.getMaterial();
} }
if (OrePrefixes.stone.mDefaultStackSize < tItem.getItemStackLimit(new ItemStack(tItem, 1, 0))) { if (OrePrefixes.stone.mDefaultStackSize < tItem.getItemStackLimit(new ItemStack(tItem, 1, 0))) {
try {
if ((tBlock.isReplaceableOreGen(GT_Values.DW, 0, 0, 0, Blocks.stone)) || (tBlock.isReplaceableOreGen(GT_Values.DW, 0, 0, 0, Blocks.netherrack)) || (tBlock.isReplaceableOreGen(GT_Values.DW, 0, 0, 0, Blocks.end_stone))) { if ((tBlock.isReplaceableOreGen(GT_Values.DW, 0, 0, 0, Blocks.stone)) || (tBlock.isReplaceableOreGen(GT_Values.DW, 0, 0, 0, Blocks.netherrack)) || (tBlock.isReplaceableOreGen(GT_Values.DW, 0, 0, 0, Blocks.end_stone))) {
tItem.setMaxStackSize(OrePrefixes.stone.mDefaultStackSize); tItem.setMaxStackSize(OrePrefixes.stone.mDefaultStackSize);
} }
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} }
} }
if (((tItem instanceof ItemFood)) && (tItem != ItemList.IC2_Food_Can_Filled.getItem()) && (tItem != ItemList.IC2_Food_Can_Spoiled.getItem())) { if (((tItem instanceof ItemFood)) && (tItem != ItemList.IC2_Food_Can_Filled.getItem()) && (tItem != ItemList.IC2_Food_Can_Spoiled.getItem())) {
@ -260,5 +251,6 @@ public class GT_ItemIterator
} }
} }
} }
} catch (Throwable e) {/**/}
} }
} }