From 31dd0c63f2e95554918850e3d4b737ab1db1ba6a Mon Sep 17 00:00:00 2001 From: Robert Seifert Date: Mon, 13 May 2013 22:21:38 -0400 Subject: [PATCH] added config save check --- src/minecraft/fluidmech/common/FluidMech.java | 172 ++++-------------- 1 file changed, 31 insertions(+), 141 deletions(-) diff --git a/src/minecraft/fluidmech/common/FluidMech.java b/src/minecraft/fluidmech/common/FluidMech.java index d75ba91f..afa1d56f 100644 --- a/src/minecraft/fluidmech/common/FluidMech.java +++ b/src/minecraft/fluidmech/common/FluidMech.java @@ -180,8 +180,11 @@ public class FluidMech extends DummyModContainer /* ITEM DECLARATION -- COFNGI LOADER */ itemParts = new ItemParts(this.CONFIGURATION.getItem("Parts", ITEM_ID_PREFIX).getInt()); itemGauge = new ItemTools(this.CONFIGURATION.getItem("PipeGuage", ITEM_ID_PREFIX + 3).getInt()); - - CONFIGURATION.save();/* CONFIG END */ + if (CONFIGURATION.hasChanged()) + { + CONFIGURATION.save(); + } + /* CONFIG END */ proxy.preInit(); @@ -209,7 +212,7 @@ public class FluidMech extends DummyModContainer 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.authorList = Arrays.asList(new String[] { "DarkGuardsman AKA DarkCow" }); meta.credits = "Please see the website."; @@ -218,7 +221,7 @@ public class FluidMech extends DummyModContainer /* LOGGER */ FMLog.info("Loading..."); proxy.Init(); - + /* TILE ENTITY REGISTER CALLS */ GameRegistry.registerTileEntity(TileEntityPipe.class, "lmPipeTile"); GameRegistry.registerTileEntity(TileEntityGenericPipe.class, "lmGenPipeTile"); @@ -234,12 +237,7 @@ public class FluidMech extends DummyModContainer /* LANG LOADING */ FMLog.info(" Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " Languages."); - - /* MOD CHECK */ - if (!Loader.isModLoaded("BasicComponents")) - { - // FMLog.fine(""); - } + /* ORE DIRECTORY REGISTER */ OreDictionary.registerOre("bronzeTube", new ItemStack(itemParts, 1, Parts.Bronze.ordinal())); @@ -270,67 +268,33 @@ public class FluidMech extends DummyModContainer /* /******** RECIPES ************* */ // generator - 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" })); + 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" })); // pipe gauge - 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()) }); + 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()) }); // iron tube - GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Iron.ordinal()), new Object[] { - "@@@", - '@', Item.ingotIron }); + GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Iron.ordinal()), new Object[] { "@@@", '@', Item.ingotIron }); // bronze tube - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.Bronze.ordinal()), new Object[] { - "@@@", - '@', "ingotBronze" })); + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(itemParts, 4, Parts.Bronze.ordinal()), new Object[] { "@@@", '@', "ingotBronze" })); // obby tube - GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Obby.ordinal()), new Object[] { - "@@@", - '@', Block.obsidian }); + GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Obby.ordinal()), new Object[] { "@@@", '@', Block.obsidian }); // nether tube - GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Nether.ordinal()), new Object[] { - "NNN", - 'N', Block.netherrack }); + GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Nether.ordinal()), new Object[] { "NNN", 'N', Block.netherrack }); // seal - GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Seal.ordinal()), new Object[] { - "@@", - "@@", - '@', Item.leather }); + GameRegistry.addRecipe(new ItemStack(itemParts, 4, Parts.Seal.ordinal()), new Object[] { "@@", "@@", '@', Item.leather }); // 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) }); // part valve - GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), new Object[] { - "T@T", - 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()), '@', Block.lever }); + GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), new Object[] { "T@T", 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()), '@', Block.lever }); // unfinished tank - GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), new Object[] { - " @ ", - "@ @", - " @ ", - '@', Item.ingotIron }); + GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), new Object[] { " @ ", "@ @", " @ ", '@', Item.ingotIron }); // mechanical rod - GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { - "I@I", - 'I', Item.ingotIron, - '@', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) }); + GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { "I@I", 'I', Item.ingotIron, '@', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) }); // 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()) }); // Lava Tube - 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()) }); + 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()) }); // 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()) }); @@ -347,110 +311,36 @@ public class FluidMech extends DummyModContainer { if (pipeMeta != ColorCode.WHITE.ordinal() && pipeMeta != ColorCode.NONE.ordinal()) { - GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, pipeMeta), new Object[] { - " P ", - "PCP", - " P ", - 'P', blockGenPipe, - 'C', new ItemStack(Item.dyePowder, 1, pipeMeta) }); + GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, pipeMeta), new Object[] { " 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', blockPipe }); // 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[] { - " P ", - "PCP", - " P ", - 'P', blockGenPipe, - 'C', new ItemStack(Item.dyePowder, 1, 15) }); + GameRegistry.addRecipe(new ItemStack(blockGenPipe, 4, ColorCode.WHITE.ordinal()), new Object[] { " P ", "PCP", " P ", 'P', blockGenPipe, 'C', new ItemStack(Item.dyePowder, 1, 15) }); // lava tank - 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 }); + 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 }); // water tank - 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()) }); + 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()) }); // milk tank - 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 }); + 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 }); // generic Tank - GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.NONE.ordinal()), new Object[] { - "@@@", - "@T@", - "@@@", - 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), - '@', Block.stone }); + GameRegistry.addRecipe(new ItemStack(blockTank, 1, ColorCode.NONE.ordinal()), new Object[] { "@@@", "@T@", "@@@", 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), '@', Block.stone }); // pump - 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" })); + 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" })); // construction pump - 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" })); + 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" })); // Drain - 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()) }); + 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()) }); // release valve - 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 }); + 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 }); // sink - GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { - "I I", - "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 }); + GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { "I I", "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"); }