TryCatch changes
This commit is contained in:
parent
0345ada52c
commit
009709462e
13 changed files with 632 additions and 701 deletions
|
@ -58,8 +58,7 @@ import java.util.*;
|
|||
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;")
|
||||
public class GT_Mod
|
||||
implements IGT_Mod {
|
||||
public class GT_Mod implements IGT_Mod {
|
||||
public static final int VERSION = 509;
|
||||
public static final int REQUIRED_IC2 = 624;
|
||||
@Mod.Instance("gregtech")
|
||||
|
@ -104,13 +103,11 @@ public class GT_Mod
|
|||
if (GregTech_API.sPreloadStarted) {
|
||||
return;
|
||||
}
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTPreload) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTPreload) {
|
||||
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");
|
||||
Configuration tMainConfig = new Configuration(tFile);
|
||||
tMainConfig.load();
|
||||
|
@ -367,13 +364,11 @@ public class GT_Mod
|
|||
GregTech_API.sPreloadFinished = true;
|
||||
GT_Log.out.println("GT_Mod: Preload-Phase finished!");
|
||||
GT_Log.ore.println("GT_Mod: Preload-Phase finished!");
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTPreload) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTPreload) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
@ -381,13 +376,11 @@ public class GT_Mod
|
|||
if (GregTech_API.sLoadStarted) {
|
||||
return;
|
||||
}
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTLoad) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTLoad) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
|
||||
new GT_Bees();
|
||||
|
||||
|
@ -400,13 +393,11 @@ public class GT_Mod
|
|||
GregTech_API.sLoadFinished = true;
|
||||
GT_Log.out.println("GT_Mod: Load-Phase finished!");
|
||||
GT_Log.ore.println("GT_Mod: Load-Phase finished!");
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTLoad) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTLoad) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
@ -414,13 +405,11 @@ public class GT_Mod
|
|||
if (GregTech_API.sPostloadStarted) {
|
||||
return;
|
||||
}
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTPostload) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTPostload) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
gregtechproxy.onPostLoad();
|
||||
if (gregtechproxy.mSortToTheEnd) {
|
||||
gregtechproxy.registerUnificationEntries();
|
||||
|
@ -605,13 +594,11 @@ public class GT_Mod
|
|||
GregTech_API.sPostloadFinished = true;
|
||||
GT_Log.out.println("GT_Mod: PostLoad-Phase finished!");
|
||||
GT_Log.ore.println("GT_Mod: PostLoad-Phase finished!");
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTPostload) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTPostload) {
|
||||
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");
|
||||
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);
|
||||
|
@ -700,13 +687,11 @@ public class GT_Mod
|
|||
|
||||
@Mod.EventHandler
|
||||
public void onServerStarting(FMLServerStartingEvent aEvent) {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
gregtechproxy.onServerStarting();
|
||||
GT_Log.out.println("GT_Mod: Unificating outputs of all known Recipe Types.");
|
||||
ArrayList<ItemStack> tStacks = new ArrayList(10000);
|
||||
|
@ -840,13 +825,11 @@ public class GT_Mod
|
|||
GregTech_API.mServerStarted = true;
|
||||
GT_Log.out.println("GT_Mod: ServerStarting-Phase finished!");
|
||||
GT_Log.ore.println("GT_Mod: ServerStarting-Phase finished!");
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTServerstart) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTServerstart) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
@ -858,14 +841,12 @@ public class GT_Mod
|
|||
public void onIDChangingEvent(FMLModIdMappingEvent aEvent) {
|
||||
GT_Utility.reInit();
|
||||
GT_Recipe.reInit();
|
||||
try {
|
||||
for (Iterator i$ = GregTech_API.sItemStackMappings.iterator(); i$.hasNext(); ) {
|
||||
Map tMap = (Map) i$.next();
|
||||
try {
|
||||
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)
|
||||
|
@ -880,13 +861,11 @@ public class GT_Mod
|
|||
|
||||
@Mod.EventHandler
|
||||
public void onServerStopping(FMLServerStoppingEvent aEvent) {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstop) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sBeforeGTServerstop) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
gregtechproxy.onServerStopping();
|
||||
try {
|
||||
if ((GT_Values.D1) || (GT_Log.out != System.out)) {
|
||||
|
@ -954,13 +933,11 @@ public class GT_Mod
|
|||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTServerstop) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sAfterGTServerstop) {
|
||||
tRunnable.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
}
|
||||
|
||||
public boolean isServerSide() {
|
||||
|
|
|
@ -120,8 +120,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
|
|||
use(aStack, 0, aPlayer);
|
||||
isItemStackUsable(aStack);
|
||||
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
|
||||
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
try {
|
||||
try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
|
||||
if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
|
||||
return true;
|
||||
|
@ -141,8 +140,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
|
|||
use(aStack, 0, aPlayer);
|
||||
isItemStackUsable(aStack);
|
||||
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
|
||||
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
try {
|
||||
try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
|
||||
if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
|
||||
return true;
|
||||
|
@ -162,8 +160,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
|
|||
use(aStack, 0, aPlayer);
|
||||
isItemStackUsable(aStack);
|
||||
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
|
||||
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
try {
|
||||
try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
|
||||
if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
|
||||
return true;
|
||||
|
@ -183,8 +180,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
|
|||
use(aStack, 0, aPlayer);
|
||||
isItemStackUsable(aStack);
|
||||
ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
|
||||
if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
try {
|
||||
try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
|
||||
aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
|
||||
} catch (Throwable e) {
|
||||
if (D1) e.printStackTrace(GT_Log.err);
|
||||
|
|
|
@ -180,8 +180,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
|
|||
|
||||
long tTime = System.currentTimeMillis();
|
||||
|
||||
for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
|
||||
try {
|
||||
try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
|
||||
switch (tCode) {
|
||||
case 0:
|
||||
tCode++;
|
||||
|
@ -286,11 +285,10 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
|
|||
tCode = -1;
|
||||
break;
|
||||
}
|
||||
} 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!!!");
|
||||
}} 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!!!");
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
|
||||
if (isServerSide() && hasValidMetaTileEntity()) {
|
||||
tTime = System.currentTimeMillis() - tTime;
|
||||
|
@ -706,7 +704,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
|
|||
}
|
||||
|
||||
@Override
|
||||
public ITexture[] getTexture(Block aBlock, byte aSide) {
|
||||
public ITexture[] getTexture(byte aSide) {
|
||||
ITexture rIcon = getCoverTexture(aSide);
|
||||
if (rIcon != null) return new ITexture[]{rIcon};
|
||||
return getTextureUncovered(aSide);
|
||||
|
|
|
@ -251,8 +251,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
mRunningThroughTick = true;
|
||||
long tTime = System.currentTimeMillis();
|
||||
|
||||
for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
|
||||
try {
|
||||
try { for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
|
||||
switch (tCode) {
|
||||
case 0:
|
||||
tCode++;
|
||||
|
@ -448,12 +447,6 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
|
||||
if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) {
|
||||
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)
|
||||
mMetaTileEntity.mInventory[i] = null;
|
||||
mInventoryChanged = true;
|
||||
|
@ -529,12 +522,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
default:
|
||||
tCode = -1;
|
||||
break;
|
||||
}
|
||||
}}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
if (isServerSide() && hasValidMetaTileEntity()) {
|
||||
tTime = System.currentTimeMillis() - tTime;
|
||||
|
|
|
@ -30,27 +30,23 @@ public class GT_FluidStack extends FluidStack {
|
|||
}
|
||||
|
||||
public static final synchronized void fixAllThoseFuckingFluidIDs() {
|
||||
if (ForgeVersion.getBuildVersion() < 1355) {
|
||||
while (lock) {
|
||||
if (ForgeVersion.getBuildVersion() < 1355 && ForgeVersion.getRevisionVersion() < 4) {
|
||||
try {
|
||||
while (lock) {
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
}} catch (InterruptedException e) {}
|
||||
lock = true;
|
||||
for (GT_FluidStack tFluid : sAllFluidStacks) tFluid.fixFluidIDForFucksSake();
|
||||
for (Map<Fluid, ?> tMap : GregTech_API.sFluidMappings)
|
||||
try {
|
||||
for (Map<Fluid, ?> tMap : GregTech_API.sFluidMappings)
|
||||
GT_Utility.reMap(tMap);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
public final void fixFluidIDForFucksSake() {
|
||||
if (ForgeVersion.getBuildVersion() < 1355) {
|
||||
if (ForgeVersion.getBuildVersion() < 1355 && ForgeVersion.getRevisionVersion() < 4) {
|
||||
int fluidID;
|
||||
try {
|
||||
fluidID = this.getFluid().getID();
|
||||
|
@ -67,7 +63,7 @@ public class GT_FluidStack extends FluidStack {
|
|||
|
||||
@Override
|
||||
public FluidStack copy() {
|
||||
if (ForgeVersion.getBuildVersion() < 1355) {
|
||||
if (ForgeVersion.getBuildVersion() < 1355 && ForgeVersion.getRevisionVersion() < 4) {
|
||||
fixFluidIDForFucksSake();
|
||||
}
|
||||
return new GT_FluidStack(this);
|
||||
|
|
|
@ -1993,16 +1993,14 @@ public class GT_Utility {
|
|||
if (aStack != null) {
|
||||
NBTTagList nbttaglist = aStack.getEnchantmentTagList();
|
||||
if (nbttaglist != null) {
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
try {
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
short short1 = nbttaglist.getCompoundTagAt(i).getShort("id");
|
||||
short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl");
|
||||
if (Enchantment.enchantmentsList[short1] != null)
|
||||
aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2);
|
||||
} catch (Throwable e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {/**/}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,9 +204,9 @@ public class GT_Client extends GT_Proxy
|
|||
|
||||
public void onPostLoad() {
|
||||
super.onPostLoad();
|
||||
try {
|
||||
label0:
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++)
|
||||
try {
|
||||
do {
|
||||
if (i >= GregTech_API.METATILEENTITIES.length)
|
||||
continue label0;
|
||||
|
@ -214,9 +214,7 @@ public class GT_Client extends GT_Proxy
|
|||
GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
|
||||
i++;
|
||||
} while (true);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
|
||||
|
||||
// super.onPostLoad();
|
||||
|
|
|
@ -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");
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
try {
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
for (; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
if (GregTech_API.METATILEENTITIES[i] != null) {
|
||||
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.");
|
||||
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;
|
||||
|
@ -740,17 +738,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
|
|||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
try {
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
for (; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
if (GregTech_API.METATILEENTITIES[i] != null) {
|
||||
GregTech_API.METATILEENTITIES[i].onServerStart();
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
}
|
||||
|
||||
public void onServerStarted() {
|
||||
|
@ -782,17 +778,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
|
|||
File tSaveDirectory = getSaveDirectory();
|
||||
GregTech_API.sWirelessRedstone.clear();
|
||||
if (tSaveDirectory != null) {
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
try {
|
||||
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
for (; i < GregTech_API.METATILEENTITIES.length; i++) {
|
||||
if (GregTech_API.METATILEENTITIES[i] != null) {
|
||||
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;
|
||||
}
|
||||
|
@ -1413,15 +1407,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
|
|||
File tSaveDiretory = getSaveDirectory();
|
||||
if (tSaveDiretory != null) {
|
||||
this.isFirstServerWorldTick = false;
|
||||
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
|
||||
try {
|
||||
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
|
||||
if (tMetaTileEntity != null) {
|
||||
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))) {
|
||||
|
|
|
@ -112,13 +112,11 @@ public class GT_Worldgenerator
|
|||
if (tBiome == null) {
|
||||
tBiome = BiomeGenBase.plains.biomeName;
|
||||
}
|
||||
for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) {
|
||||
try {
|
||||
for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) {
|
||||
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++;
|
||||
}
|
||||
i++;
|
||||
|
|
|
@ -212,15 +212,13 @@ public class GT_Block_Machines
|
|||
GregTech_API.sBlockIcons = aIconRegister;
|
||||
|
||||
GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures");
|
||||
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
|
||||
try {
|
||||
for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
|
||||
if (tMetaTileEntity != null) {
|
||||
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");
|
||||
try {
|
||||
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");
|
||||
System.out.println("GT_Mod: Starting Block Icon Load Phase");
|
||||
for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
|
||||
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");
|
||||
System.out.println("GT_Mod: Finished Block Icon Load Phase");
|
||||
}
|
||||
|
|
|
@ -98,13 +98,11 @@ public class GT_IntegratedCircuit_Item
|
|||
GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase");
|
||||
System.out.println("GT_Mod: Starting Item Icon Load Phase");
|
||||
GregTech_API.sItemIcons = aIconRegister;
|
||||
for (Runnable tRunnable : GregTech_API.sGTItemIconload) {
|
||||
try {
|
||||
for (Runnable tRunnable : GregTech_API.sGTItemIconload) {
|
||||
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");
|
||||
System.out.println("GT_Mod: Finished Item Icon Load Phase");
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class Behaviour_DataOrb
|
|||
}
|
||||
|
||||
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(getDataName(aStack));
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public class GT_ItemIterator
|
|||
|
||||
GT_Log.out.println("GT_Mod: Scanning ItemList.");
|
||||
|
||||
try {
|
||||
Iterator tIterator = Item.itemRegistry.iterator();
|
||||
while (tIterator.hasNext()) {
|
||||
Object tObject;
|
||||
|
@ -61,7 +62,6 @@ public class GT_ItemIterator
|
|||
Item tItem = (Item) tObject;
|
||||
String tName;
|
||||
if ((tName = tItem.getUnlocalizedName()) != null) {
|
||||
try {
|
||||
if ((tItem instanceof IToolCrowbar)) {
|
||||
if ((!tItem.isDamageable()) && (!GT_ModHandler.isElectricItem(new ItemStack(tItem, 1, 0)))) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
try {
|
||||
if ((tItem instanceof IToolWrench)) {
|
||||
if ((!tItem.isDamageable()) && (!GT_ModHandler.isElectricItem(new ItemStack(tItem, 1, 0)))) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
Block tBlock = GT_Utility.getBlockFromStack(new ItemStack(tItem, 1, 0));
|
||||
if (tBlock != null) {
|
||||
if (tName.endsWith("beehives")) {
|
||||
|
@ -94,13 +89,9 @@ public class GT_ItemIterator
|
|||
gregtech.common.tools.GT_Tool_Scoop.sBeeHiveMaterial = tBlock.getMaterial();
|
||||
}
|
||||
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))) {
|
||||
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())) {
|
||||
|
@ -260,5 +251,6 @@ public class GT_ItemIterator
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {/**/}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue