added config save check

This commit is contained in:
Robert Seifert 2013-05-13 22:21:38 -04:00
parent f2f2ad1dac
commit 31dd0c63f2

View file

@ -180,8 +180,11 @@ public class FluidMech extends DummyModContainer
/* ITEM DECLARATION -- COFNGI LOADER */ /* ITEM DECLARATION -- COFNGI LOADER */
itemParts = new ItemParts(this.CONFIGURATION.getItem("Parts", ITEM_ID_PREFIX).getInt()); itemParts = new ItemParts(this.CONFIGURATION.getItem("Parts", ITEM_ID_PREFIX).getInt());
itemGauge = new ItemTools(this.CONFIGURATION.getItem("PipeGuage", ITEM_ID_PREFIX + 3).getInt()); itemGauge = new ItemTools(this.CONFIGURATION.getItem("PipeGuage", ITEM_ID_PREFIX + 3).getInt());
if (CONFIGURATION.hasChanged())
CONFIGURATION.save();/* CONFIG END */ {
CONFIGURATION.save();
}
/* CONFIG END */
proxy.preInit(); proxy.preInit();
@ -209,7 +212,7 @@ public class FluidMech extends DummyModContainer
meta.url = "http://www.universalelectricity.com/fluidmechanics"; meta.url = "http://www.universalelectricity.com/fluidmechanics";
meta.logoFile = FluidMech.TEXTURE_DIRECTORY+"FM_Banner.png"; meta.logoFile = FluidMech.TEXTURE_DIRECTORY + "FM_Banner.png";
meta.version = FluidMech.VERSION; meta.version = FluidMech.VERSION;
meta.authorList = Arrays.asList(new String[] { "DarkGuardsman AKA DarkCow" }); meta.authorList = Arrays.asList(new String[] { "DarkGuardsman AKA DarkCow" });
meta.credits = "Please see the website."; meta.credits = "Please see the website.";
@ -235,11 +238,6 @@ public class FluidMech extends DummyModContainer
/* LANG LOADING */ /* LANG LOADING */
FMLog.info(" Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " Languages."); FMLog.info(" Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " Languages.");
/* MOD CHECK */
if (!Loader.isModLoaded("BasicComponents"))
{
// FMLog.fine("");
}
/* ORE DIRECTORY REGISTER */ /* ORE DIRECTORY REGISTER */
OreDictionary.registerOre("bronzeTube", new ItemStack(itemParts, 1, Parts.Bronze.ordinal())); OreDictionary.registerOre("bronzeTube", new ItemStack(itemParts, 1, Parts.Bronze.ordinal()));
@ -270,67 +268,33 @@ public class FluidMech extends DummyModContainer
/* /******** RECIPES ************* */ /* /******** RECIPES ************* */
// generator // generator
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.blockGenerator, 1), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.blockGenerator, 1), new Object[] { "@T@", "OVO", "@T@", 'T', new ItemStack(FluidMech.blockRod, 1), '@', "plateSteel", 'O', "basicCircuit", 'V', "motor" }));
"@T@",
"OVO",
"@T@",
'T', new ItemStack(FluidMech.blockRod, 1),
'@', "plateSteel",
'O', "basicCircuit",
'V', "motor" }));
// pipe gauge // pipe gauge
GameRegistry.addRecipe(new ItemStack(this.itemGauge, 1, 0), new Object[] { GameRegistry.addRecipe(new ItemStack(this.itemGauge, 1, 0), new Object[] { "TVT", " T ", 'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) });
"TVT",
" T ",
'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()),
'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) });
// iron tube // iron tube
GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Iron.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Iron.ordinal()), new Object[] { "@@@", '@', Item.ingotIron });
"@@@",
'@', Item.ingotIron });
// bronze tube // bronze tube
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.Bronze.ordinal()), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.Bronze.ordinal()), new Object[] { "@@@", '@', "ingotBronze" }));
"@@@",
'@', "ingotBronze" }));
// obby tube // obby tube
GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Obby.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Obby.ordinal()), new Object[] { "@@@", '@', Block.obsidian });
"@@@",
'@', Block.obsidian });
// nether tube // nether tube
GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Nether.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Nether.ordinal()), new Object[] { "NNN", 'N', Block.netherrack });
"NNN",
'N', Block.netherrack });
// seal // seal
GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Seal.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Seal.ordinal()), new Object[] { "@@", "@@", '@', Item.leather });
"@@",
"@@",
'@', Item.leather });
// slime steal // slime steal
GameRegistry.addShapelessRecipe(new ItemStack(itemParts, 1, Parts.SlimeSeal.ordinal()), new Object[] { new ItemStack(itemParts, 1, Parts.Seal.ordinal()), new ItemStack(Item.slimeBall, 1) }); GameRegistry.addShapelessRecipe(new ItemStack(itemParts, 1, Parts.SlimeSeal.ordinal()), new Object[] { new ItemStack(itemParts, 1, Parts.Seal.ordinal()), new ItemStack(Item.slimeBall, 1) });
// part valve // part valve
GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), new Object[] { "T@T", 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()), '@', Block.lever });
"T@T",
'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()), '@', Block.lever });
// unfinished tank // unfinished tank
GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), new Object[] { " @ ", "@ @", " @ ", '@', Item.ingotIron });
" @ ",
"@ @",
" @ ",
'@', Item.ingotIron });
// mechanical rod // mechanical rod
GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { "I@I", 'I', Item.ingotIron, '@', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) });
"I@I",
'I', Item.ingotIron,
'@', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) });
// Iron Pipe // Iron Pipe
GameRegistry.addShapelessRecipe(new ItemStack(blockPipe, 1, 15), new Object[] { new ItemStack(itemParts, 1, Parts.Iron.ordinal()), new ItemStack(itemParts, 1, Parts.Seal.ordinal()) }); GameRegistry.addShapelessRecipe(new ItemStack(blockPipe, 1, 15), new Object[] { new ItemStack(itemParts, 1, Parts.Iron.ordinal()), new ItemStack(itemParts, 1, Parts.Seal.ordinal()) });
// Lava Tube // Lava Tube
GameRegistry.addRecipe(new ItemStack(blockPipe, 1, ColorCode.RED.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(blockPipe, 1, ColorCode.RED.ordinal()), new Object[] { "N@N", 'N', new ItemStack(itemParts, 1, Parts.Nether.ordinal()), '@', new ItemStack(itemParts, 1, Parts.Obby.ordinal()) });
"N@N",
'N', new ItemStack(itemParts, 1, Parts.Nether.ordinal()),
'@', new ItemStack(itemParts, 1, Parts.Obby.ordinal()) });
// fuel pipe // fuel pipe
GameRegistry.addShapelessRecipe(new ItemStack(blockPipe, 4, ColorCode.YELLOW.ordinal()), new Object[] { new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(itemParts, 1, Parts.SlimeSeal.ordinal()) }); GameRegistry.addShapelessRecipe(new ItemStack(blockPipe, 4, ColorCode.YELLOW.ordinal()), new Object[] { new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(blockGenPipe, 1, ColorCode.YELLOW.ordinal()), new ItemStack(itemParts, 1, Parts.SlimeSeal.ordinal()) });
@ -347,110 +311,36 @@ public class FluidMech extends DummyModContainer
{ {
if (pipeMeta != ColorCode.WHITE.ordinal() && pipeMeta != ColorCode.NONE.ordinal()) if (pipeMeta != ColorCode.WHITE.ordinal() && pipeMeta != ColorCode.NONE.ordinal())
{ {
GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, pipeMeta), new Object[] { GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, pipeMeta), new Object[] { " P ", "PCP", " P ", 'P', blockGenPipe, 'C', new ItemStack(Item.dyePowder, 1, pipeMeta) });
" P ",
"PCP",
" P ",
'P', blockGenPipe,
'C', new ItemStack(Item.dyePowder, 1, pipeMeta) });
} }
} }
GameRegistry.addRecipe(new ItemStack(blockGenPipe, 1, 15), new Object[] { "P", 'P', blockGenPipe }); GameRegistry.addRecipe(new ItemStack(blockGenPipe, 1, 15), new Object[] { "P", 'P', blockGenPipe });
GameRegistry.addRecipe(new ItemStack(blockGenPipe, 1, 15), new Object[] { "P", 'P', blockPipe }); GameRegistry.addRecipe(new ItemStack(blockGenPipe, 1, 15), new Object[] { "P", 'P', blockPipe });
// white pipe crafting -- has to be separate since iron pipe is #15 instead of white // white pipe crafting -- has to be separate since iron pipe is #15 instead of white
GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, ColorCode.WHITE.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, ColorCode.WHITE.ordinal()), new Object[] { " P ", "PCP", " P ", 'P', blockGenPipe, 'C', new ItemStack(Item.dyePowder, 1, 15) });
" P ",
"PCP",
" P ",
'P', blockGenPipe,
'C', new ItemStack(Item.dyePowder, 1, 15) });
// lava tank // lava tank
GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.RED.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.RED.ordinal()), new Object[] { "N@N", "@ @", "N@N", 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), '@', Block.obsidian, 'N', Block.netherrack });
"N@N",
"@ @",
"N@N",
'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()),
'@', Block.obsidian, 'N', Block.netherrack });
// water tank // water tank
GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.BLUE.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.BLUE.ordinal()), new Object[] { "@G@", "STS", "@G@", 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), '@', Block.planks, 'G', Block.glass, 'S', new ItemStack(itemParts, 1, Parts.Seal.ordinal()) });
"@G@",
"STS",
"@G@",
'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()),
'@', Block.planks,
'G', Block.glass,
'S', new ItemStack(itemParts, 1, Parts.Seal.ordinal()) });
// milk tank // milk tank
GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.WHITE.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.WHITE.ordinal()), new Object[] { "W@W", "WTW", "W@W", 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), '@', Block.stone, 'W', Block.planks });
"W@W",
"WTW",
"W@W",
'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()),
'@', Block.stone,
'W', Block.planks });
// generic Tank // generic Tank
GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.NONE.ordinal()), new Object[] { GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.NONE.ordinal()), new Object[] { "@@@", "@T@", "@@@", 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), '@', Block.stone });
"@@@",
"@T@",
"@@@",
'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()),
'@', Block.stone });
// pump // pump
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(blockMachine, 1, 0), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(blockMachine, 1, 0), new Object[] { "C@C", "BMB", "@X@", '@', "plateSteel", 'X', new ItemStack(blockPipe, 1), 'B', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), 'C', "basicCircuit", 'M', "motor" }));
"C@C",
"BMB",
"@X@",
'@', "plateSteel",
'X', new ItemStack(blockPipe, 1),
'B', new ItemStack(itemParts, 1, Parts.Valve.ordinal()),
'C', "basicCircuit",
'M', "motor" }));
// construction pump // construction pump
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(blockConPump, 1, 0), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(blockConPump, 1, 0), new Object[] { "@C@", "BMB", "@@@", '@', "plateSteel", 'B', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), 'C', "advancedCircuit", 'M', "motor" }));
"@C@",
"BMB",
"@@@",
'@', "plateSteel",
'B', new ItemStack(itemParts, 1, Parts.Valve.ordinal()),
'C', "advancedCircuit",
'M', "motor" }));
// Drain // Drain
GameRegistry.addRecipe(new ItemStack(blockDrain, 1, 0), new Object[] { GameRegistry.addRecipe(new ItemStack(blockDrain, 1, 0), new Object[] { "IGI", "SVS", " P ", 'I', Item.ingotIron, 'G', Block.dispenser, 'S', Block.stone, 'P', new ItemStack(blockPipe, 1), 'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()) });
"IGI",
"SVS",
" P ",
'I', Item.ingotIron,
'G', Block.dispenser,
'S', Block.stone,
'P', new ItemStack(blockPipe, 1),
'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()) });
// release valve // release valve
GameRegistry.addRecipe(new ItemStack(blockReleaseValve, 1), new Object[] { GameRegistry.addRecipe(new ItemStack(blockReleaseValve, 1), new Object[] { "RPR", "PVP", "RPR", 'P', new ItemStack(blockPipe, 1), 'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), 'R', Item.redstone });
"RPR",
"PVP",
"RPR",
'P', new ItemStack(blockPipe, 1),
'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()),
'R', Item.redstone });
// sink // sink
GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { "I I", "SIS", "SPS", 'P', new ItemStack(blockPipe, 1), 'I', Item.ingotIron, 'S', Block.stone });
"I I", GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { "I I", "SIS", "SPS", 'P', new ItemStack(blockGenPipe, 1), 'I', Item.ingotIron, 'S', Block.stone });
"SIS",
"SPS",
'P', new ItemStack(blockPipe, 1),
'I', Item.ingotIron,
'S', Block.stone });
GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] {
"I I",
"SIS",
"SPS",
'P', new ItemStack(blockGenPipe, 1),
'I', Item.ingotIron,
'S', Block.stone });
FMLog.info("Done Loading"); FMLog.info("Done Loading");
} }