diff options
Diffstat (limited to 'src/Java/gtPlusPlus/GTplusplus.java')
-rw-r--r-- | src/Java/gtPlusPlus/GTplusplus.java | 107 |
1 files changed, 54 insertions, 53 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 79e943d9bd..045e0a535b 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -2,7 +2,19 @@ package gtPlusPlus; import static gtPlusPlus.core.lib.CORE.DEBUG; import static gtPlusPlus.core.lib.CORE.configSwitches.*; -import gregtech.api.util.*; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.Collection; + +import cpw.mods.fml.common.*; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.event.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; import gtPlusPlus.core.commands.CommandMath; @@ -18,23 +30,12 @@ import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.util.Collection; - import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.common.*; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.*; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @Mod(modid=CORE.MODID, name=CORE.name, version=CORE.VERSION, dependencies="required-after:Forge; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO;") public class GTplusplus implements ActionListener -{ +{ @Mod.Instance(CORE.MODID) public static GTplusplus instance; @@ -46,16 +47,16 @@ implements ActionListener - public static void handleConfigFile(FMLPreInitializationEvent event) { - Configuration config = new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); + public static void handleConfigFile(final FMLPreInitializationEvent event) { + final Configuration config = new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); config.load(); - + //Debug DEBUG = config.getBoolean("debugMode", "debug", false, "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)"); disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, "Disables EnderIO Integration."); - - + + //Machines enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, "Allows the use of TC shards across many recipes by oreDicting them into a common group."); enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, "Adds a non-Antimony using Battery Alloy. Not Balanced at all.."); @@ -65,16 +66,16 @@ implements ActionListener //Tools CORE.configSwitches.enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true, "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench."); CORE.configSwitches.enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true, "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available."); - + //Pipes & Cables CORE.configSwitches.enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, "Adds Custom GT Fluid Pipes."); CORE.configSwitches.enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, "Adds Custom GT Cables."); - + //Block Drops CORE.configSwitches.chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0, 10000, "Drained shards have a 1 in X chance to drop."); CORE.configSwitches.chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0, 10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone.."); - - + + //Single machines CORE.configSwitches.enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech", false, "These may be overpowered, Consult a local electrician."); CORE.configSwitches.enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true, "These protect your goodies/rare stuff."); @@ -83,8 +84,8 @@ implements ActionListener CORE.configSwitches.enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true, "Portable fluid tanks."); CORE.configSwitches.enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech", true, "Diesel egines with different internals, they consume less fuel overall."); CORE.configSwitches.enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines", "gregtech", true, "These may be overpowered, Consult a local geologist."); - - + + //Multi machines CORE.configSwitches.enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter", "gregtech", true, "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal."); CORE.configSwitches.enableMultiblock_IndustrialCentrifuge = config.getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin."); @@ -99,15 +100,15 @@ implements ActionListener CORE.configSwitches.enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation", "gregtech", true, "For managing large power grids."); CORE.configSwitches.enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean("enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids."); CORE.configSwitches.enableMultiblock_NuclearFuelRefinery = config.getBoolean("enableMultiblock_NuclearFuelRefinery", "gregtech", true, "Refines molten chemicals into nuclear fuels."); - - + + //Options RF2EU_Battery.rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)"); //Features enableCustomAlvearyBlocks = config.getBoolean("enableCustomAlvearyBlocks", "features", false, "Enables Custom Alveary Blocks."); - config.save(); + config.save(); } public static String randomDust_A; @@ -117,15 +118,15 @@ implements ActionListener protected void FirstCall(){ Utils.LOG_WARNING("Summoning up mystic powers."); - String[] infusedDusts = {"Fire", "Water", "Earth", "Air", "Order", "Entropy"}; - int a = MathUtils.randInt(0, 5); - int b = MathUtils.randInt(0, 5); - int c = MathUtils.randInt(0, 5); - int d = MathUtils.randInt(0, 5); - String infusedDust1 = "dustInfused"+infusedDusts[a]; - String infusedDust2 = "dustInfused"+infusedDusts[b]; - String infusedDust3 = "dustInfused"+infusedDusts[c]; - String infusedDust4 = "dustInfused"+infusedDusts[d]; + final String[] infusedDusts = {"Fire", "Water", "Earth", "Air", "Order", "Entropy"}; + final int a = MathUtils.randInt(0, 5); + final int b = MathUtils.randInt(0, 5); + final int c = MathUtils.randInt(0, 5); + final int d = MathUtils.randInt(0, 5); + final String infusedDust1 = "dustInfused"+infusedDusts[a]; + final String infusedDust2 = "dustInfused"+infusedDusts[b]; + final String infusedDust3 = "dustInfused"+infusedDusts[c]; + final String infusedDust4 = "dustInfused"+infusedDusts[d]; Utils.LOG_INFO("Found the aspect of "+infusedDusts[a]+" to embody into energy crystals."); Utils.LOG_INFO("Found the aspect of "+infusedDusts[b]+" to embody into energy crystals."); Utils.LOG_INFO("Found the aspect of "+infusedDusts[c]+" to embody into energy crystals."); @@ -137,7 +138,7 @@ implements ActionListener //ItemStack a1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[a], 8); //ItemStack b1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[b], 8); //ItemStack c1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[c], 8); - //ItemStack d1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[d], 8); + //ItemStack d1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[d], 8); } @@ -157,12 +158,12 @@ implements ActionListener //Pre-Init @Mod.EventHandler - public void preInit(FMLPreInitializationEvent event) + public void preInit(final FMLPreInitializationEvent event) { Utils.LOG_INFO("Loading "+CORE.name+" V"+CORE.VERSION); Utils.LOG_INFO("Latest is "+CORE.MASTER_VERSION+". Updated? "+Utils.isModUpToDate()); //FirstCall(); - FMLCommonHandler.instance().bus().register(new LoginEventHandler()); + FMLCommonHandler.instance().bus().register(new LoginEventHandler()); Utils.LOG_INFO("Login Handler Initialized"); handleConfigFile(event); @@ -174,9 +175,9 @@ implements ActionListener //Init @Mod.EventHandler - public void init(FMLInitializationEvent event) + public void init(final FMLInitializationEvent event) { - proxy.init(event); + proxy.init(event); //MinecraftForge.EVENT_BUS.register(this); //FMLCommonHandler.instance().bus().register(this); proxy.registerNetworkStuff(); @@ -184,14 +185,14 @@ implements ActionListener //Post-Init @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) { - proxy.postInit(event); + public void postInit(final FMLPostInitializationEvent event) { + proxy.postInit(event); if (DEBUG){ - dumpGtRecipeMap(Gregtech_Recipe_Map.sChemicalDehydratorRecipes); - dumpGtRecipeMap(Gregtech_Recipe_Map.sCokeOvenRecipes); - dumpGtRecipeMap(Gregtech_Recipe_Map.sMatterFab2Recipes); - dumpGtRecipeMap(Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes); + this.dumpGtRecipeMap(Gregtech_Recipe_Map.sChemicalDehydratorRecipes); + this.dumpGtRecipeMap(Gregtech_Recipe_Map.sCokeOvenRecipes); + this.dumpGtRecipeMap(Gregtech_Recipe_Map.sMatterFab2Recipes); + this.dumpGtRecipeMap(Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes); } //~ @@ -206,26 +207,26 @@ implements ActionListener } @EventHandler - public void serverStarting(FMLServerStartingEvent event) + public void serverStarting(final FMLServerStartingEvent event) { event.registerServerCommand(new CommandMath()); } @Mod.EventHandler - public void serverStopping(FMLServerStoppingEvent event) + public void serverStopping(final FMLServerStoppingEvent event) { } @Override - public void actionPerformed(ActionEvent arg0) { + public void actionPerformed(final ActionEvent arg0) { } - protected void dumpGtRecipeMap(GT_Recipe_Map r){ - Collection<GT_Recipe> x = r.mRecipeList; + protected void dumpGtRecipeMap(final GT_Recipe_Map r){ + final Collection<GT_Recipe> x = r.mRecipeList; Utils.LOG_INFO("Dumping "+r.mUnlocalizedName+" Recipes for Debug."); - for(GT_Recipe newBo : x){ + for(final GT_Recipe newBo : x){ Utils.LOG_INFO("========================"); Utils.LOG_INFO("Dumping Input: "+ItemUtils.getArrayStackNames(newBo.mInputs)); Utils.LOG_INFO("Dumping Inputs "+ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs)); |