diff options
Diffstat (limited to 'src/main/java/gregtech/GT_Mod.java')
-rw-r--r-- | src/main/java/gregtech/GT_Mod.java | 297 |
1 files changed, 142 insertions, 155 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index c64460f911..bca9719839 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -13,6 +13,7 @@ import gregtech.api.enums.*; import gregtech.api.interfaces.internal.IGT_Mod; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; +import gregtech.api.objects.XSTR; import gregtech.api.util.*; import gregtech.common.GT_DummyWorld; import gregtech.common.GT_Network; @@ -56,14 +57,8 @@ import java.io.PrintStream; import java.util.*; import java.util.Map.Entry; -//import forestry.factory.recipes.ISqueezerRecipe; -//import forestry.factory.tiles.TileCentrifuge; -//import forestry.factory.tiles.TileSqueezer; - - @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") @@ -72,6 +67,8 @@ public class GT_Mod public static GT_Proxy gregtechproxy; public static int MAX_IC2 = 2147483647; public static GT_Achievements achievements; + private final String aTextGeneral = "general"; + private final String aTextIC2 = "ic2_"; static { if ((509 != GregTech_API.VERSION) || (509 != GT_ModHandler.VERSION) || (509 != GT_OreDictUnificator.VERSION) || (509 != GT_Recipe.VERSION) || (509 != GT_Utility.VERSION) || (509 != GT_RecipeRegistrator.VERSION) || (509 != Element.VERSION) || (509 != Materials.VERSION) || (509 != OrePrefixes.VERSION)) { @@ -106,13 +103,11 @@ public class GT_Mod if (GregTech_API.sPreloadStarted) { return; } - for (Runnable tRunnable : GregTech_API.sBeforeGTPreload) { - try { + 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(); @@ -148,7 +143,7 @@ public class GT_Mod } catch (Throwable e) { } } - if (tMainConfig.get("general", "LoggingPlayerActivity", true).getBoolean(true)) { + if (tMainConfig.get(aTextGeneral, "LoggingPlayerActivity", true).getBoolean(true)) { GT_Log.mPlayerActivityLogFile = new File(aEvent.getModConfigurationDirectory().getParentFile(), "logs/PlayerActivity.log"); if (!GT_Log.mPlayerActivityLogFile.exists()) { try { @@ -178,15 +173,15 @@ public class GT_Mod gregtechproxy.onPreLoad(); GT_Log.out.println("GT_Mod: Setting Configs"); - GT_Values.D1 = tMainConfig.get("general", "Debug", false).getBoolean(false); - GT_Values.D2 = tMainConfig.get("general", "Debug2", false).getBoolean(false); + GT_Values.D1 = tMainConfig.get(aTextGeneral, "Debug", false).getBoolean(false); + GT_Values.D2 = tMainConfig.get(aTextGeneral, "Debug2", false).getBoolean(false); - GregTech_API.TICKS_FOR_LAG_AVERAGING = tMainConfig.get("general", "TicksForLagAveragingWithScanner", 25).getInt(25); - GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = tMainConfig.get("general", "MillisecondsPassedInGTTileEntityUntilLagWarning", 100).getInt(100); - if (tMainConfig.get("general", "disable_STDOUT", false).getBoolean(false)) { + GregTech_API.TICKS_FOR_LAG_AVERAGING = tMainConfig.get(aTextGeneral, "TicksForLagAveragingWithScanner", 25).getInt(25); + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = tMainConfig.get(aTextGeneral, "MillisecondsPassedInGTTileEntityUntilLagWarning", 100).getInt(100); + if (tMainConfig.get(aTextGeneral, "disable_STDOUT", false).getBoolean(false)) { System.out.close(); } - if (tMainConfig.get("general", "disable_STDERR", false).getBoolean(false)) { + if (tMainConfig.get(aTextGeneral, "disable_STDERR", false).getBoolean(false)) { System.err.close(); } GregTech_API.sMachineExplosions = tMainConfig.get("machines", "machines_explosion_damage", true).getBoolean(false); @@ -199,41 +194,43 @@ public class GT_Mod GregTech_API.sConstantEnergy = tMainConfig.get("machines", "constant_need_of_energy", true).getBoolean(false); GregTech_API.sColoredGUI = tMainConfig.get("machines", "colored_guis_when_painted", true).getBoolean(false); - GregTech_API.sTimber = tMainConfig.get("general", "timber_axe", false).getBoolean(false); - GregTech_API.sDrinksAlwaysDrinkable = tMainConfig.get("general", "drinks_always_drinkable", false).getBoolean(false); - GregTech_API.sDoShowAllItemsInCreative = tMainConfig.get("general", "show_all_metaitems_in_creative_and_NEI", false).getBoolean(false); - GregTech_API.sMultiThreadedSounds = tMainConfig.get("general", "sound_multi_threading", false).getBoolean(false); + GregTech_API.sTimber = tMainConfig.get(aTextGeneral, "timber_axe", false).getBoolean(false); + GregTech_API.sDrinksAlwaysDrinkable = tMainConfig.get(aTextGeneral, "drinks_always_drinkable", false).getBoolean(false); + GregTech_API.sDoShowAllItemsInCreative = tMainConfig.get(aTextGeneral, "show_all_metaitems_in_creative_and_NEI", false).getBoolean(false); + GregTech_API.sMultiThreadedSounds = tMainConfig.get(aTextGeneral, "sound_multi_threading", false).getBoolean(false); + String SBdye0 = "ColorModulation."; for (Dyes tDye : Dyes.values()) { if ((tDye != Dyes._NULL) && (tDye.mIndex < 0)) { - tDye.mRGBa[0] = ((short) Math.min(255, Math.max(0, GregTech_API.sClientDataFile.get("ColorModulation." + tDye, "R", tDye.mRGBa[0])))); - tDye.mRGBa[1] = ((short) Math.min(255, Math.max(0, GregTech_API.sClientDataFile.get("ColorModulation." + tDye, "G", tDye.mRGBa[1])))); - tDye.mRGBa[2] = ((short) Math.min(255, Math.max(0, GregTech_API.sClientDataFile.get("ColorModulation." + tDye, "B", tDye.mRGBa[2])))); - } - } - gregtechproxy.mMaxEqualEntitiesAtOneSpot = tMainConfig.get("general", "MaxEqualEntitiesAtOneSpot", 3).getInt(3); - gregtechproxy.mSkeletonsShootGTArrows = tMainConfig.get("general", "SkeletonsShootGTArrows", 16).getInt(16); - gregtechproxy.mFlintChance = tMainConfig.get("general", "FlintAndSteelChance", 30).getInt(30); - gregtechproxy.mItemDespawnTime = tMainConfig.get("general", "ItemDespawnTime", 6000).getInt(6000); - gregtechproxy.mDisableVanillaOres = tMainConfig.get("general", "DisableVanillaOres", true).getBoolean(true); - gregtechproxy.mNerfDustCrafting = tMainConfig.get("general", "NerfDustCrafting", true).getBoolean(true); - gregtechproxy.mIncreaseDungeonLoot = tMainConfig.get("general", "IncreaseDungeonLoot", true).getBoolean(true); - gregtechproxy.mAxeWhenAdventure = tMainConfig.get("general", "AdventureModeStartingAxe", true).getBoolean(true); - gregtechproxy.mHardcoreCables = tMainConfig.get("general", "HardCoreCableLoss", false).getBoolean(false); - gregtechproxy.mSurvivalIntoAdventure = tMainConfig.get("general", "forceAdventureMode", false).getBoolean(false); - gregtechproxy.mHungerEffect = tMainConfig.get("general", "AFK_Hunger", false).getBoolean(false); - gregtechproxy.mHardRock = tMainConfig.get("general", "harderstone", false).getBoolean(false); - gregtechproxy.mInventoryUnification = tMainConfig.get("general", "InventoryUnification", true).getBoolean(true); - gregtechproxy.mGTBees = tMainConfig.get("general", "GTBees", true).getBoolean(true); - gregtechproxy.mCraftingUnification = tMainConfig.get("general", "CraftingUnification", true).getBoolean(true); - gregtechproxy.mNerfedWoodPlank = tMainConfig.get("general", "WoodNeedsSawForCrafting", true).getBoolean(true); - gregtechproxy.mNerfedVanillaTools = tMainConfig.get("general", "smallerVanillaToolDurability", true).getBoolean(true); - gregtechproxy.mSortToTheEnd = tMainConfig.get("general", "EnsureToBeLoadedLast", true).getBoolean(true); - gregtechproxy.mDisableIC2Cables = tMainConfig.get("general", "DisableIC2Cables", true).getBoolean(true); - gregtechproxy.mAchievements = tMainConfig.get("general", "EnableAchievements", true).getBoolean(true); + String SBdye1 = new StringBuilder(18).append(SBdye0).append(tDye).toString(); + tDye.mRGBa[0] = ((short) Math.min(255, Math.max(0, GregTech_API.sClientDataFile.get(SBdye1, "R", tDye.mRGBa[0])))); + tDye.mRGBa[1] = ((short) Math.min(255, Math.max(0, GregTech_API.sClientDataFile.get(SBdye1, "G", tDye.mRGBa[1])))); + tDye.mRGBa[2] = ((short) Math.min(255, Math.max(0, GregTech_API.sClientDataFile.get(SBdye1, "B", tDye.mRGBa[2])))); + } + } + gregtechproxy.mMaxEqualEntitiesAtOneSpot = tMainConfig.get(aTextGeneral, "MaxEqualEntitiesAtOneSpot", 3).getInt(3); + gregtechproxy.mSkeletonsShootGTArrows = tMainConfig.get(aTextGeneral, "SkeletonsShootGTArrows", 16).getInt(16); + gregtechproxy.mFlintChance = tMainConfig.get(aTextGeneral, "FlintAndSteelChance", 30).getInt(30); + gregtechproxy.mItemDespawnTime = tMainConfig.get(aTextGeneral, "ItemDespawnTime", 6000).getInt(6000); + gregtechproxy.mDisableVanillaOres = tMainConfig.get(aTextGeneral, "DisableVanillaOres", true).getBoolean(true); + gregtechproxy.mNerfDustCrafting = tMainConfig.get(aTextGeneral, "NerfDustCrafting", true).getBoolean(true); + gregtechproxy.mIncreaseDungeonLoot = tMainConfig.get(aTextGeneral, "IncreaseDungeonLoot", true).getBoolean(true); + gregtechproxy.mAxeWhenAdventure = tMainConfig.get(aTextGeneral, "AdventureModeStartingAxe", true).getBoolean(true); + gregtechproxy.mHardcoreCables = tMainConfig.get(aTextGeneral, "HardCoreCableLoss", false).getBoolean(false); + gregtechproxy.mSurvivalIntoAdventure = tMainConfig.get(aTextGeneral, "forceAdventureMode", false).getBoolean(false); + gregtechproxy.mHungerEffect = tMainConfig.get(aTextGeneral, "AFK_Hunger", false).getBoolean(false); + gregtechproxy.mHardRock = tMainConfig.get(aTextGeneral, "harderstone", false).getBoolean(false); + gregtechproxy.mInventoryUnification = tMainConfig.get(aTextGeneral, "InventoryUnification", true).getBoolean(true); + gregtechproxy.mGTBees = tMainConfig.get(aTextGeneral, "GTBees", true).getBoolean(true); + gregtechproxy.mCraftingUnification = tMainConfig.get(aTextGeneral, "CraftingUnification", true).getBoolean(true); + gregtechproxy.mNerfedWoodPlank = tMainConfig.get(aTextGeneral, "WoodNeedsSawForCrafting", true).getBoolean(true); + gregtechproxy.mNerfedVanillaTools = tMainConfig.get(aTextGeneral, "smallerVanillaToolDurability", true).getBoolean(true); + gregtechproxy.mSortToTheEnd = tMainConfig.get(aTextGeneral, "EnsureToBeLoadedLast", true).getBoolean(true); + gregtechproxy.mDisableIC2Cables = tMainConfig.get(aTextGeneral, "DisableIC2Cables", true).getBoolean(true); + gregtechproxy.mAchievements = tMainConfig.get(aTextGeneral, "EnableAchievements", true).getBoolean(true); gregtechproxy.mAE2Integration = GregTech_API.sSpecialFile.get(ConfigCategories.general, "EnableAE2Integration", Loader.isModLoaded("appliedenergistics2")); - gregtechproxy.mNerfedCombs = tMainConfig.get("general", "NerfCombs", true).getBoolean(true); - gregtechproxy.mHideUnusedOres = tMainConfig.get("general", "HideUnusedOres", true).getBoolean(true); - gregtechproxy.mHideRecyclingRecipes = tMainConfig.get("general", "HideRecyclingRecipes", true).getBoolean(true); + gregtechproxy.mNerfedCombs = tMainConfig.get(aTextGeneral, "NerfCombs", true).getBoolean(true); + gregtechproxy.mHideUnusedOres = tMainConfig.get(aTextGeneral, "HideUnusedOres", true).getBoolean(true); + gregtechproxy.mHideRecyclingRecipes = tMainConfig.get(aTextGeneral, "HideRecyclingRecipes", true).getBoolean(true); GregTech_API.mOutputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "OutputRF", true); GregTech_API.mInputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "InputRF", false); @@ -244,18 +241,18 @@ public class GT_Mod gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties.get("havestLevel", "activateHarvestLevelChange", false); if(gregtechproxy.mChangeHarvestLevels){ - gregtechproxy.mGraniteHavestLevel = (int) GregTech_API.sMaterialProperties.get("havestLevel", "graniteHarvestLevel", 3); - gregtechproxy.mMaxHarvestLevel=(int) Math.min(15, GregTech_API.sMaterialProperties.get("havestLevel", "maxLevel",7)); - for(Materials tMaterial : Materials.values()){ - if(tMaterial!=null&&tMaterial.mToolQuality>0&&tMaterial.mMetaItemSubID<gregtechproxy.mHarvestLevel.length&&tMaterial.mMetaItemSubID>=0){ - gregtechproxy.mHarvestLevel[tMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties.get("materialHavestLevel", tMaterial.mDefaultLocalName,tMaterial.mToolQuality); - } - }} - - if (tMainConfig.get("general", "hardermobspawners", true).getBoolean(true)) { + gregtechproxy.mGraniteHavestLevel = (int) GregTech_API.sMaterialProperties.get("havestLevel", "graniteHarvestLevel", 3); + gregtechproxy.mMaxHarvestLevel=(int) Math.min(15, GregTech_API.sMaterialProperties.get("havestLevel", "maxLevel",7)); + for(Materials tMaterial : Materials.values()){ + if(tMaterial!=null&&tMaterial.mToolQuality>0&&tMaterial.mMetaItemSubID<gregtechproxy.mHarvestLevel.length&&tMaterial.mMetaItemSubID>=0){ + gregtechproxy.mHarvestLevel[tMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties.get("materialHavestLevel", tMaterial.mDefaultLocalName,tMaterial.mToolQuality); + } + }} + + if (tMainConfig.get(aTextGeneral, "hardermobspawners", true).getBoolean(true)) { Blocks.mob_spawner.setHardness(500.0F).setResistance(6000000.0F); } - gregtechproxy.mOnline = tMainConfig.get("general", "online", true).getBoolean(false); + gregtechproxy.mOnline = tMainConfig.get(aTextGeneral, "online", true).getBoolean(false); gregtechproxy.mUpgradeCount = Math.min(64, Math.max(1, tMainConfig.get("features", "UpgradeStacksize", 4).getInt())); for (OrePrefixes tPrefix : OrePrefixes.values()) { @@ -347,7 +344,8 @@ public class GT_Mod List<ModContainer> tModList = tLoadController.getActiveModList(); List<ModContainer> tNewModsList = new ArrayList(); ModContainer tGregTech = null; - for (short i = 0; i < tModList.size(); i = (short) (i + 1)) { + short tModList_sS= (short) tModList.size(); + for (short i = 0; i < tModList_sS; i = (short) (i + 1)) { ModContainer tMod = (ModContainer) tModList.get(i); if (tMod.getModId().equalsIgnoreCase("gregtech")) { tGregTech = tMod; @@ -368,13 +366,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 { + 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 @@ -382,16 +378,14 @@ public class GT_Mod if (GregTech_API.sLoadStarted) { return; } - for (Runnable tRunnable : GregTech_API.sBeforeGTLoad) { - try { + 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(); - + gregtechproxy.onLoad(); if (gregtechproxy.mSortToTheEnd) { new GT_ItemIterator().run(); @@ -401,13 +395,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 { + 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 @@ -415,13 +407,11 @@ public class GT_Mod if (GregTech_API.sPostloadStarted) { return; } - for (Runnable tRunnable : GregTech_API.sBeforeGTPostload) { - try { + 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(); @@ -457,7 +447,10 @@ public class GT_Mod FMLLog.info("If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager.", new Object[0]); gregtechproxy.activateOreDictHandler(); FMLLog.info("Congratulations, you have been waiting long enough. Have a Cake.", new Object[0]); - GT_Log.out.println("GT_Mod: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList.size() + " Recipes were left unused."); + GT_Log.out.println("GT_Mod: List of Lists of Tool Recipes: "+GT_ModHandler.sSingleNonBlockDamagableRecipeList_list.toString()); + GT_Log.out.println("GT_Mod: Vanilla Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sVanillaRecipeList_warntOutput.toString()); + GT_Log.out.println("GT_Mod: Single Non Block Damagable Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList_warntOutput.toString()); + GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles); if (GT_Values.D1) { IRecipe tRecipe; for (Iterator i$ = GT_ModHandler.sSingleNonBlockDamagableRecipeList.iterator(); i$.hasNext(); GT_Log.out.println("=> " + tRecipe.getRecipeOutput().getDisplayName())) { @@ -470,10 +463,12 @@ public class GT_Mod } GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item("machine", 1L)); GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("machine", 1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "RwR", "RRR", Character.valueOf('R'), OrePrefixes.plate.get(Materials.Iron)}); + ItemStack ISdata0 = new ItemStack(Items.potionitem, 1, 0); + ItemStack ILdata0 = ItemList.Bottle_Empty.get(1L, new Object[0]); for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) { - GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{ItemList.Bottle_Empty.get(1L, new Object[0])}, new ItemStack[]{new ItemStack(Items.potionitem, 1, 0)}, null, new FluidStack[]{Materials.Water.getFluid(250L)}, null, 4, 1, 0); - GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{new ItemStack(Items.potionitem, 1, 0)}, new ItemStack[]{ItemList.Bottle_Empty.get(1L, new Object[0])}, null, null, null, 4, 1, 0); + GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{ILdata0}, new ItemStack[]{ISdata0}, null, new FluidStack[]{Materials.Water.getFluid(250L)}, null, 4, 1, 0); + GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{ISdata0}, new ItemStack[]{ILdata0}, null, null, null, 4, 1, 0); } else { GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{tData.emptyContainer}, new ItemStack[]{tData.filledContainer}, null, new FluidStack[]{tData.fluid}, null, tData.fluid.amount / 62, 1, 0); GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{tData.filledContainer}, new ItemStack[]{GT_Utility.getContainerItem(tData.filledContainer, true)}, null, null, new FluidStack[]{tData.fluid}, tData.fluid.amount / 62, 1, 0); @@ -509,58 +504,58 @@ public class GT_Mod } } String tName = ""; - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "blastfurnace"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "blastfurnace"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "blockcutter"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "blockcutter"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "inductionFurnace"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "inductionFurnace"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "generator"), false)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "generator"), false)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "windMill"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "windMill"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "waterMill"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "waterMill"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "solarPanel"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "solarPanel"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "centrifuge"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "centrifuge"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "electrolyzer"), false)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "electrolyzer"), false)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "compressor"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "compressor"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "electroFurnace"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "electroFurnace"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "extractor"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "extractor"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "macerator"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "macerator"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "recycler"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "recycler"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "metalformer"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "metalformer"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "orewashingplant"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "orewashingplant"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "massFabricator"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "massFabricator"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } - if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2_" + (tName = "replicator"), true)) { + if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + (tName = "replicator"), true)) { GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item(tName, 1L)); } if (gregtechproxy.mNerfedVanillaTools) { @@ -603,13 +598,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 { + 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); @@ -652,14 +645,18 @@ public class GT_Mod Behaviour_DataOrb.setDataTitle(tOutput, "Elemental-Scan"); Behaviour_DataOrb.setDataName(tOutput, tMaterial.mElement.name()); ItemStack tInput = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L); + ItemStack[] ISmat0 = new ItemStack[]{tInput}; + ItemStack[] ISmat1 = new ItemStack[]{tOutput}; if (tInput != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{tInput}, new ItemStack[]{tOutput}, ItemList.Tool_DataOrb.get(1L, new Object[0]), null, null, (int) (tMaterial.getMass() * 8192L), 32, 0); - GT_Recipe.GT_Recipe_Map.sRepicatorFakeRecipes.addFakeRecipe(false, null, new ItemStack[]{tInput}, new ItemStack[]{tOutput}, new FluidStack[]{Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), 32, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, ISmat0, ISmat1, ItemList.Tool_DataOrb.get(1L, new Object[0]), null, null, (int) (tMaterial.getMass() * 8192L), 32, 0); + GT_Recipe.GT_Recipe_Map.sRepicatorFakeRecipes.addFakeRecipe(false, null, ISmat0, ISmat1, new FluidStack[]{Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), 32, 0); + } tInput = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L); + ISmat0 = new ItemStack[]{tInput}; if (tInput != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{tInput}, new ItemStack[]{tOutput}, ItemList.Tool_DataOrb.get(1L, new Object[0]), null, null, (int) (tMaterial.getMass() * 8192L), 32, 0); - GT_Recipe.GT_Recipe_Map.sRepicatorFakeRecipes.addFakeRecipe(false, null, new ItemStack[]{tInput}, new ItemStack[]{tOutput}, new FluidStack[]{Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), 32, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, ISmat0, ISmat1, ItemList.Tool_DataOrb.get(1L, new Object[0]), null, null, (int) (tMaterial.getMass() * 8192L), 32, 0); + GT_Recipe.GT_Recipe_Map.sRepicatorFakeRecipes.addFakeRecipe(false, null, ISmat0, ISmat1, new FluidStack[]{Materials.UUMatter.getFluid(tMaterial.getMass())}, null, (int) (tMaterial.getMass() * 512L), 32, 0); } } } @@ -678,11 +675,11 @@ public class GT_Mod } if(GregTech_API.mOutputRF||GregTech_API.mInputRF){ - GT_Utility.checkAvailabilities(); - if(!GT_Utility.RF_CHECK){ - GregTech_API.mOutputRF = false; - GregTech_API.mInputRF = false; - } + GT_Utility.checkAvailabilities(); + if(!GT_Utility.RF_CHECK){ + GregTech_API.mOutputRF = false; + GregTech_API.mInputRF = false; + } } achievements = new GT_Achievements(); @@ -698,13 +695,11 @@ public class GT_Mod @Mod.EventHandler public void onServerStarting(FMLServerStartingEvent aEvent) { - for (Runnable tRunnable : GregTech_API.sBeforeGTServerstart) { - try { + 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); @@ -770,34 +765,34 @@ public class GT_Mod } } GT_Log.out.println("GT_Mod: Dungeon Loot"); - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("dungeonChest").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("dungeonChest").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("bonusChest").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("bonusChest").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("villageBlacksmith").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("villageBlacksmith").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdCrossing").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdCrossing").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdLibrary").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdLibrary").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdCorridor").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdCorridor").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidJungleDispenser").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidJungleDispenser").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidJungleChest").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidJungleChest").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidDesertyChest").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidDesertyChest").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } - for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("mineshaftCorridor").getItems(new Random())) { + for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("mineshaftCorridor").getItems(new XSTR())) { tStacks.add(tContent.theItemId); } GT_Log.out.println("GT_Mod: Smelting"); @@ -838,13 +833,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 { + 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 @@ -856,14 +849,12 @@ public class GT_Mod public void onIDChangingEvent(FMLModIdMappingEvent aEvent) { GT_Utility.reInit(); GT_Recipe.reInit(); - for (Iterator i$ = GregTech_API.sItemStackMappings.iterator(); i$.hasNext(); ) { - Map tMap = (Map) i$.next(); - try { + try { + for (Iterator i$ = GregTech_API.sItemStackMappings.iterator(); i$.hasNext(); ) { + Map tMap = (Map) i$.next(); 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) @@ -878,13 +869,11 @@ public class GT_Mod @Mod.EventHandler public void onServerStopping(FMLServerStoppingEvent aEvent) { - for (Runnable tRunnable : GregTech_API.sBeforeGTServerstop) { - try { + 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)) { @@ -952,13 +941,11 @@ public class GT_Mod e.printStackTrace(GT_Log.err); } } - for (Runnable tRunnable : GregTech_API.sAfterGTServerstop) { - try { + 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() { |