From 7e7dfc7dde2ae79d38c0f299d2b5e1eca3e015b9 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Mon, 31 Mar 2014 00:19:23 -0400 Subject: [PATCH 01/35] Still attempting to fix build.gradle --- build.gradle | 6 +++--- src/main/resources/mcmod.info | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 45b25b9..3b7fb01 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,6 @@ task buildInfo { } else { ext.revision = "GITBORK" } - if (System.getenv().BUILD_NUMBER != null) { ext.buildNum = "${System.getenv().BUILD_NUMBER}" } else { @@ -47,7 +46,8 @@ if (System.getenv().ARTIFACT_VERSION != null) { artifact_version = "${system.getenv().ARTIFACT_VERSION}" } -version = "MC${config.minecraft_version}-${artifact_version}-${System.getenv().BUILD_NUMBER}" +version = "MC${config.minecraft_version}-${artifact_version}-${buildInfo.buildNum}" +def actualVersion = "${artifact_version}-${buildInfo.buildNum}" minecraft { version = "1.6.4-9.11.1.964" @@ -64,7 +64,7 @@ processResources include 'mcmod.info' // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version + expand 'version':actualVersion, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 6973d09..43ea018 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ "modid": "TPPITweaks", "name": "TPPI Tweaks", "description": "Does some useful stuff for the TPPI modpack.", - "version": "1.0.0", + "version": "${version}", "mcversion": "1.6.4", "authors": [ "The TPPI Team" ], "requiredMods": [ "Forge" ] From 4b95cb479a3b93e5bbf54ecec9fae28acdf1f51b Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Mon, 31 Mar 2014 19:03:02 -0400 Subject: [PATCH 02/35] Close TPPI-Dev/TestPackPleaseIgnore/issues/264 Hopefully fixes breaking /help --- src/main/java/tppitweaks/TPPITweaks.java | 2 +- .../java/tppitweaks/command/CommandTPPI.java | 6 ++++++ .../config/ConfigurationHandler.java | 21 +++++++++---------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index aad1451..46500db 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -89,7 +89,7 @@ public void preInit(FMLPreInitializationEvent event) { @EventHandler public void init(FMLInitializationEvent event) { - AM2SpawnControls.doAM2SpawnControls(); + //AM2SpawnControls.doAM2SpawnControls(); eventHandler = new TPPIEventHandler(); MinecraftForge.EVENT_BUS.register(eventHandler); diff --git a/src/main/java/tppitweaks/command/CommandTPPI.java b/src/main/java/tppitweaks/command/CommandTPPI.java index 28d2e0a..f190041 100644 --- a/src/main/java/tppitweaks/command/CommandTPPI.java +++ b/src/main/java/tppitweaks/command/CommandTPPI.java @@ -320,4 +320,10 @@ public int compareTo(Object arg0) { return this.compareTo((ICommand) arg0); } + + @Override + public boolean equals(Object obj) + { + return this.compareTo(obj) == 0; + } } diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 2f7b82b..2c12e05 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -104,8 +104,8 @@ public static void init(File file) blockID = config.getBlock("tppiBlockId", 3115).getInt(); - bookID = config.getItem("tppiBookId", 21000).getInt() - 256; - materialID = config.getItem("tppiMaterialId", 21001).getInt() - 256; + bookID = config.getItem("tppiBookId", 21650).getInt() - 256; + materialID = config.getItem("tppiMaterialId", 21651).getInt() - 256; bookTitle = config.get("TPPI Guide Info", "bookTitle", "TPPI Welcome Packet", "The title of the custom spawn book", Type.STRING).getString(); bookAuthor = config.get("TPPI Guide Info", "bookAuthor", "The TPPI Team", "The author of the custom spawn book", Type.STRING).getString(); @@ -117,16 +117,15 @@ public static void init(File file) enderPouchNerf = config.get("Ender Storage Tweaks", "enderPouchNerf", true, "EnderStorage Ender Pouches require pyrotheum dust and liquid ender instead of blaze rods and ender pearls.").getBoolean(true); enderTankTesseract = config.get("Ender Storage Tweaks", "enderTankTesseract", true, "EnderStorage Ender Tanks require tesseracts instead of ender pearls.").getBoolean(true); - steelReactorCasings = config.get("Other Mod Tweaks", "steelReactorCasings", true, "Big Reactors reactor casings require steel. Affects ONLY the casings.").getBoolean(true); - ic2TEGlassInterchangeability = config.get("Other Mod Tweaks", "ic2TEGlassInterchangeability", true, "IC2 reinforced glass (glassReinforced) and Thermal Expansion hardened glass (glassHardened)\nwill be cross-registered as each other in the ore dictionary.").getBoolean(true); + steelReactorCasings = config.get("Other Mod Tweaks", "steelReactorCasings", false, "Big Reactors reactor casings require steel. Affects ONLY the casings.").getBoolean(true); + ic2TEGlassInterchangeability = config.get("Other Mod Tweaks", "ic2TEGlassInterchangeability", true, "IC2 reinforced glass (glassReinforced) and Thermal Expansion hardened glass (glassHardened)\nwill be cross-registered as each other in the ore dictionary.").getBoolean(false); tweakDA = config.get("Other Mod Tweaks", "tweakDARecipe", true, "Make Dimensional Anchors' recipe closer to that of a chicken chunks chunk loader.").getBoolean(true); tweakSFM = config.get("Other Mod Tweaks", "stevesFactoryManagerAERecipes", true, "Recipes from Steve's Factory Manager take items from Applied Energistics.").getBoolean(true); tweakAM2 = config.get("Other Mod Tweaks", "addAM2NatureGuardianRecipe", true, "Add recipe for Ars Magica 2 Nature Guardian spawn egg. Useful when dryads are disabled.").getBoolean(true); - glassFuelRods = config.get("Other Mod Tweaks", "glassFuelRods", true, "Big Reactors fuel rods take just a touch of reactor glass.").getBoolean(true); + glassFuelRods = config.get("Other Mod Tweaks", "glassFuelRods", false, "Big Reactors fuel rods take just a touch of reactor glass.").getBoolean(false); eloraamBreakersAndDeployers = config.get("Other Mod Tweaks", "eloraamBreakersAndDeployers", true, "OpenBlocks block breakers and placers have the same recipes as Redpower 2's.").getBoolean(true); removeStupidEnergyCrystalRecipe = config.get("Other Mod Tweaks", "removeDartCraftEnergyCrystalRecipe", true, "Remove DartCraft's IC2 energy crystal recipe.").getBoolean(true); disableForceShears = config.get("Other Mod Tweaks", "disableForceShears", true, "Remove the force shears recipe because they were crashing servers rarely, but in a serious way. Disable this at your own risk.").getBoolean(true); - disableAGAutoOutputter = config.get("Other Mod Tweaks", "disableAGAutoOutputter", true, "Remove the recipe for the Advanced Genetics auto output upgrade, because crashes.").getBoolean(true); fixExURecipes = config.get("ExtraUtils Tweaks", "fixExtraUtilsRecipes", true, "Current version of ExU has broken recipes for the unstable ingot block. This fixes that.").getBoolean(true); @@ -144,17 +143,17 @@ public static void init(File file) readdResinSmelting = config.get("Gregtech Tweaks", "readdResinSmelting", true, "Re-add the IC2 sticky resin to rubber smelting recipe.").getBoolean(true); doCharcoalBlockCompression = config.get("Gregtech Tweaks", "doCharcoalBlockCompression", true, "Charcoal blocks can be compressed to coal via compressor.").getBoolean(true); - showDownloadGUI = config.get("Mod Downloads", "showDownloadGUI", true, "Show the Download GUI on startup.").getBoolean(true); - showMaricultureGui = config.get("Mod Loading Tweaks", "showMaricultureGUI", true, "Show the mariculture fix GUI on startup.").getBoolean(true); + showDownloadGUI = config.get("Mod Downloads", "showDownloadGUI", false, "Show the Download GUI on startup.").getBoolean(true); + showMaricultureGui = config.get("Mod Loading Tweaks", "showMaricultureGUI", false, "Show the mariculture fix GUI on startup.").getBoolean(false); registerMagicalCropsOre = config.get("Other Mod Tweaks", "registerMagicalCropsOre", true, "Register essence ores from Magical Crops in the ore dictionary under \"oreMCropsEssence\" and \"oreMCropsNetherEssence\".").getBoolean(true); harderActivatorRecipe = config.get("Other Mod Tweaks", "harderActivatorRecipe", true, "Make the autonomous activator recipe slightly harder").getBoolean(true); harderLillipadRecipe = config.get("Other Mod Tweaks", "harderLillipadOfFertility", true, "Make the lillipad of fertility much harder to craft").getBoolean(true); - addEssenceSeedRecipe = config.get("Other Mod Tweaks", "addEssenceSeedRecipe", true, "Add a recipe for the essence seeds in magical crops").getBoolean(true); + addEssenceSeedRecipe = config.get("Other Mod Tweaks", "addEssenceSeedRecipe", false, "Add a recipe for the essence seeds in magical crops").getBoolean(false); addOsmiumToOreWasher = config.get("Mekanism Tweaks", "addOsmiumToOreWasher", true, "Add a recipe for impure osmium dust to clean osmium dust in the IC2 ore washer.").getBoolean(true); harderDisassemblerRecipe = config.get("Mekanism Tweaks", "harderAtomicDisassembler", true, "Makes the recipe for the Atomic Disassembler much more difficult").getBoolean(true); - disableCardboardBox = config.get("Mekanism Tweaks", "disableCardboardBox", true, "Remove the recipe for the cardboard box (it can move ANY tile entity including nodes and spanwers)").getBoolean(true); + disableCardboardBox = config.get("Mekanism Tweaks", "disableCardboardBox", false, "Remove the recipe for the cardboard box (it can move ANY tile entity including nodes and spanwers)").getBoolean(false); disableMiner = config.get("Mekanism Tweaks", "disableDigitalMiner", false, "Remove the recipe for the digital miner (not really any reason to do this now but I'm not deleting code)").getBoolean(false); nerfMiner = config.get("Mekanism Tweaks", "nerfDigitalMiner", true, "Make the recipe for the digital miner a bit...ok a lot harder").getBoolean(true); @@ -165,7 +164,7 @@ public static void init(File file) Reference.KAMIFilename = config.get("Mod Loading Tweaks", "KAMI_filename", Reference.DEFAULT_KAMI_FILENAME, "The filename for KAMI to use to check for its presence and disable/enable it automatically").getString(); Reference.packName = config.get("Pack Info", "packName", "Test Pack Please Ignore", "The full name of the pack").getString(); - Reference.packVersion = config.get("Pack Info", "packVerison", "0.0.1", "The version of the pack").getString(); + Reference.packVersion = config.get("Pack Info", "packVerison", "1.0.0", "The version of the pack").getString(); Reference.packAcronym = config.get("Pack Info", "packAcronym", "TPPI", "The acronym of the pack (required, can be the same as name)").getString(); allowCapes = config.get("Pack Info", "allowDevCapes", true, "Enables/Disables the visibility of dev capes. This only affects the user and does NOT have to be the same between client and server.").getBoolean(true); From 53dbfee173b8261f6fab8c06c12bfc37d16f29fa Mon Sep 17 00:00:00 2001 From: Tristen Allen Date: Tue, 1 Apr 2014 00:02:22 -0400 Subject: [PATCH 03/35] Buff output of reactor glass As it stands, reactor glass is more expensive than reactor casing. As it costs more to make, this recipe has been buffed to encourage aesthetically pleasing and resource-efficient designs. --- .../config/ConfigurationHandler.java | 2 ++ .../modTweaks/BigReactorsTweaks.java | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 2c12e05..b985991 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -34,6 +34,7 @@ public class ConfigurationHandler public static boolean enderTankTesseract; public static boolean steelReactorCasings; public static boolean glassFuelRods; + public static boolean twoReactorGlass; public static boolean eloraamBreakersAndDeployers; public static boolean ic2TEGlassInterchangeability; public static boolean tweakDA; @@ -123,6 +124,7 @@ public static void init(File file) tweakSFM = config.get("Other Mod Tweaks", "stevesFactoryManagerAERecipes", true, "Recipes from Steve's Factory Manager take items from Applied Energistics.").getBoolean(true); tweakAM2 = config.get("Other Mod Tweaks", "addAM2NatureGuardianRecipe", true, "Add recipe for Ars Magica 2 Nature Guardian spawn egg. Useful when dryads are disabled.").getBoolean(true); glassFuelRods = config.get("Other Mod Tweaks", "glassFuelRods", false, "Big Reactors fuel rods take just a touch of reactor glass.").getBoolean(false); + twoReactorGlass = config.get("Other Mod Tweaks", "twoReactorGlass", true, "Big Reactors\' reactor glass recipe gives two reactor glass in exchange for the harder recipe.").getBoolean(true); eloraamBreakersAndDeployers = config.get("Other Mod Tweaks", "eloraamBreakersAndDeployers", true, "OpenBlocks block breakers and placers have the same recipes as Redpower 2's.").getBoolean(true); removeStupidEnergyCrystalRecipe = config.get("Other Mod Tweaks", "removeDartCraftEnergyCrystalRecipe", true, "Remove DartCraft's IC2 energy crystal recipe.").getBoolean(true); disableForceShears = config.get("Other Mod Tweaks", "disableForceShears", true, "Remove the force shears recipe because they were crashing servers rarely, but in a serious way. Disable this at your own risk.").getBoolean(true); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index f6dac01..57c8879 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -1,6 +1,7 @@ package tppitweaks.recipetweaks.modTweaks; import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; @@ -17,7 +18,11 @@ public static void init() if (ConfigurationHandler.glassFuelRods) { TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); - } + } + if (ConfigurationHandler.twoReactorGlass) + { + TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass).blockID, 0); + } } public static void addRecipes() @@ -33,5 +38,19 @@ public static void addRecipes() GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod, 1), new Object[] { "ICI", "GUG", "ICI", Character.valueOf('I'), erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, Character.valueOf('C'), "ingotIron", Character.valueOf('U'), "ingotYellorium", Character.valueOf('G'), "ingotGraphite" })); } + if (ConfigurationHandler.twoReactorGlass) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 0, 2), + "gCg", + + 'g', "glassHardened", + 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockReactorPart, 1, 0))); + + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 0, 2), + "gCg", + + 'g', "glassReinforced", + 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockReactorPart, 1, 0))); + } } } From 88c8e133be6f709448c68d7fcb8a7d94a6ef8c5b Mon Sep 17 00:00:00 2001 From: Tristen Allen Date: Tue, 1 Apr 2014 00:10:47 -0400 Subject: [PATCH 04/35] Also for Turbine glass Can't hate on our steamy relationship, now can we? --- .../recipetweaks/modTweaks/BigReactorsTweaks.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index 57c8879..a463973 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -22,6 +22,7 @@ public static void init() if (ConfigurationHandler.twoReactorGlass) { TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass).blockID, 0); + TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass).blockID, 1); } } @@ -51,6 +52,18 @@ public static void addRecipes() 'g', "glassReinforced", 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockReactorPart, 1, 0))); + + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 1, 2), + "gCg", + + 'g', "glassHardened", + 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockTurbinePart, 1, 0))); + + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 1, 2), + "gCg", + + 'g', "glassReinforced", + 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockTurbinePart, 1, 0))); } } } From 8604b17fc6d651b317585f1528a8298f09f2de0c Mon Sep 17 00:00:00 2001 From: esKaayY Date: Tue, 1 Apr 2014 17:19:31 -0400 Subject: [PATCH 05/35] Edit Jenkins Link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2a5bff..4b33d26 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ TPPI-Tweaks =========== Random tweaks and additions for the /r/feedthebeast modpack (TestPackPleaseIgnore) -Builds: http://zone.chill.in/jenkins/job/TPPITweaks/ +Builds: http://ci.tterrag.com/job/TPPI-Tweaks/ From 9d9f7cf09accf4dd987b3ea624a527e0a5a60dbc Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Thu, 3 Apr 2014 13:46:06 -0400 Subject: [PATCH 06/35] Add a config option for spawn books and register items --- .../tppitweaks/config/ConfigurationHandler.java | 6 ++++-- src/main/java/tppitweaks/item/ModItems.java | 14 +++++++++++--- .../java/tppitweaks/util/TPPIPlayerTracker.java | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 2c12e05..5fa354a 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -77,6 +77,7 @@ public class ConfigurationHandler public static boolean showDownloadGUI; public static boolean showMaricultureGui; + public static boolean doSpawnBook; public static boolean autoEnableTT; @@ -112,7 +113,8 @@ public static void init(File file) changelogTitle = config.get("TPPI Guide Info", "changelogTitle", "TPPI Changelog", "The title of the changelog").getString(); supportedModsName = config.get("TPPI Guide Info", "supportedModsFilename", "SupportedMods", "The file name of the file to read the mod documentation from (used to support translation). Do not include the extension in the filename (it is .txt)").getString(); guideSkin = config.get("TPPI Guide Info", "TPPIGuideSkin", 0, "The skin of the guide GUI/item, 0=tech, 1=scroll").getInt(); - + doSpawnBook = config.get("TPPI Guide Info", "doSpawnBook", true, "Whether or not to give the player a welcome book on first spawn").getBoolean(true); + enderChestTesseract = config.get("Ender Storage Tweaks", "enderChestTesseract", true, "EnderStorage Ender Chests require tesseracts instead of ender pearls.").getBoolean(true); enderPouchNerf = config.get("Ender Storage Tweaks", "enderPouchNerf", true, "EnderStorage Ender Pouches require pyrotheum dust and liquid ender instead of blaze rods and ender pearls.").getBoolean(true); enderTankTesseract = config.get("Ender Storage Tweaks", "enderTankTesseract", true, "EnderStorage Ender Tanks require tesseracts instead of ender pearls.").getBoolean(true); @@ -145,7 +147,7 @@ public static void init(File file) showDownloadGUI = config.get("Mod Downloads", "showDownloadGUI", false, "Show the Download GUI on startup.").getBoolean(true); showMaricultureGui = config.get("Mod Loading Tweaks", "showMaricultureGUI", false, "Show the mariculture fix GUI on startup.").getBoolean(false); - + registerMagicalCropsOre = config.get("Other Mod Tweaks", "registerMagicalCropsOre", true, "Register essence ores from Magical Crops in the ore dictionary under \"oreMCropsEssence\" and \"oreMCropsNetherEssence\".").getBoolean(true); harderActivatorRecipe = config.get("Other Mod Tweaks", "harderActivatorRecipe", true, "Make the autonomous activator recipe slightly harder").getBoolean(true); harderLillipadRecipe = config.get("Other Mod Tweaks", "harderLillipadOfFertility", true, "Make the lillipad of fertility much harder to craft").getBoolean(true); diff --git a/src/main/java/tppitweaks/item/ModItems.java b/src/main/java/tppitweaks/item/ModItems.java index f810973..ad28468 100644 --- a/src/main/java/tppitweaks/item/ModItems.java +++ b/src/main/java/tppitweaks/item/ModItems.java @@ -14,8 +14,17 @@ public class ModItems { public static TPPIMaterial tppiMaterial; public static void initItems() { - tppiBook = new TPPIBook(ConfigurationHandler.bookID); - tppiMaterial = new TPPIMaterial(ConfigurationHandler.materialID); + if (ConfigurationHandler.bookID != 0) + { + tppiBook = new TPPIBook(ConfigurationHandler.bookID); + GameRegistry.registerItem(tppiBook, "tppiBook"); + } + + if (ConfigurationHandler.materialID != 0) + { + tppiMaterial = new TPPIMaterial(ConfigurationHandler.materialID); + GameRegistry.registerItem(tppiMaterial, "tppiMaterial"); + } } public static void registerRecipes() @@ -37,5 +46,4 @@ public static void registerRecipes() FurnaceRecipes.smelting().addSmelting(tppiMaterial.itemID, 1, new ItemStack(tppiMaterial), 0.1f); } } - } diff --git a/src/main/java/tppitweaks/util/TPPIPlayerTracker.java b/src/main/java/tppitweaks/util/TPPIPlayerTracker.java index 6eaa455..f765625 100644 --- a/src/main/java/tppitweaks/util/TPPIPlayerTracker.java +++ b/src/main/java/tppitweaks/util/TPPIPlayerTracker.java @@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import tppitweaks.TPPITweaks; +import tppitweaks.config.ConfigurationHandler; import tppitweaks.event.TPPIEventHandler; import tppitweaks.item.ModItems; import cpw.mods.fml.common.FMLCommonHandler; @@ -42,7 +43,7 @@ public void onPlayerRespawn(EntityPlayer player) private boolean addBook(EntityPlayer player) { - if (player != null && !player.getEntityData().getCompoundTag("TPPI").getBoolean("hasBook") && FMLCommonHandler.instance().getEffectiveSide().isServer()) + if (player != null && ConfigurationHandler.doSpawnBook && !player.getEntityData().getCompoundTag("TPPI").getBoolean("hasBook") && FMLCommonHandler.instance().getEffectiveSide().isServer()) { TPPITweaks.logger.log(Level.INFO, "Adding book"); From d024de83b0a9e691a5a90aed901bf34afbf3c938 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Thu, 3 Apr 2014 16:38:15 -0400 Subject: [PATCH 07/35] Remove old mods from documentation --- .../resources/assets/tppitweaks/lang/SupportedMods.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt b/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt index 7cda338..c277d2c 100644 --- a/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt +++ b/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt @@ -38,7 +38,6 @@ **industrial craft [Burn477?] (posted in r/TPPI)** **logistics pipes [Linked]** **magical crops [Linked]** -**mariculture [Linked]** **mekanism [Linked]** **MFFS [Linked]** **MPS [Linked]** @@ -493,9 +492,6 @@ wool into water or on the ground while it is raining. >Forestry-Trees, Forestry-Trees< ->GasCraft, GasCraft< - - >Gendustry, Gendustry< Gendustry is a mod that acts as an add-on for Forestry's bee and tree (and butterfly) breeding systems. It adds a number of blocks that will be discussed on the following page(s).~ @@ -648,9 +644,6 @@ Magic bees is an addon for the Forestry bee-breeding system that also utilizes T for this mod can be found under the Magic Bees tab in the Thaumonomicon. If you are confused about bees in general, please consult the "Forestry-Bees" book. ->Mariculture, Mariculture< - - >Mekanism, Mekanism< From 983d0b7cf427b1affdbce890d4e9d6a24cedce8c Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Thu, 3 Apr 2014 18:54:43 -0400 Subject: [PATCH 08/35] All files are now read from /config/TPPI. More safety checks. --- src/main/java/tppitweaks/TPPITweaks.java | 10 ++--- .../java/tppitweaks/command/CommandTPPI.java | 10 +++-- src/main/java/tppitweaks/util/FileLoader.java | 38 ++++++++++--------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index 46500db..560772a 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -3,7 +3,6 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.logging.Level; import java.util.logging.Logger; import net.minecraft.creativetab.CreativeTabs; @@ -66,17 +65,18 @@ public void preInit(FMLPreInitializationEvent event) { e.printStackTrace(); } - ConfigurationHandler.loadGuideText(FileLoader.getGuideText()); try { + ConfigurationHandler.loadGuideText(FileLoader.getGuideText()); ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText()); + CommandTPPI.initValidCommandArguments(FileLoader.getSupportedModsFile()); } catch (FileNotFoundException e) { - logger.log(Level.WARNING, "TPPI Changelog not found, please check the TPPI config folder."); + logger.severe("IO error while loading TPPITweaks, make sure nothing in the config folder is actively open and Minecraft has permission to read those files!"); + e.printStackTrace(); + throw new RuntimeException("IO Error in TPPITweaks file loading!"); } - - CommandTPPI.initValidCommandArguments(FileLoader.getSupportedModsFile()); ModItems.initItems(); ModBlocks.initBlocks(); diff --git a/src/main/java/tppitweaks/command/CommandTPPI.java b/src/main/java/tppitweaks/command/CommandTPPI.java index f190041..ea290a9 100644 --- a/src/main/java/tppitweaks/command/CommandTPPI.java +++ b/src/main/java/tppitweaks/command/CommandTPPI.java @@ -1,5 +1,6 @@ package tppitweaks.command; +import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; @@ -283,15 +284,16 @@ private void giveModBook(String modName, ICommandSender command) NBTTagList bookPages = new NBTTagList("pages"); ArrayList pages; - //try - //{ + + try + { pages = TxtParser.parseFileMods(FileLoader.getSupportedModsFile(), modName + ", " + properName); - /*} + } catch (FileNotFoundException e) { pages = new ArrayList(); e.printStackTrace(); - }*/ + } if (pages.get(0).startsWith("<") && pages.get(0).endsWith("> ")) { diff --git a/src/main/java/tppitweaks/util/FileLoader.java b/src/main/java/tppitweaks/util/FileLoader.java index b780b78..114f557 100644 --- a/src/main/java/tppitweaks/util/FileLoader.java +++ b/src/main/java/tppitweaks/util/FileLoader.java @@ -177,41 +177,43 @@ public static String manuallyGetConfigValue(Map m, String string return ""; } - public static InputStream getGuideText() + public static InputStream getGuideText() throws FileNotFoundException { - bookText = TPPITweaks.class.getResourceAsStream("/assets/tppitweaks/lang/BookText.txt"); + bookText = getFileSafe(new File(ConfigurationHandler.cfg.getParent() + "BookText.txt")); return bookText; } public static InputStream getChangelogText() throws FileNotFoundException { - File changelog = new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt"); - - if (!changelog.exists()) + changelogText = getFileSafe(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); + return changelogText; + } + + public static InputStream getSupportedModsFile() throws FileNotFoundException + { + supportedMods = getFileSafe(new File(ConfigurationHandler.cfg.getParent() + "/" + ConfigurationHandler.supportedModsName + ".txt")); + return supportedMods; + } + + private static InputStream getFileSafe(File file) throws FileNotFoundException + { + if (!file.exists()) { FileWriter fw; try { - changelog.createNewFile(); - fw = new FileWriter(changelog); - fw.write("Default Changelog, please make sure the correct changelog exists in the TPPI directory before launching next time!"); + file.createNewFile(); + fw = new FileWriter(file); + fw.write("Default file, please make sure the correct file, " + file.getName() + ", exists in the TPPI config directory before launching next time!"); fw.flush(); fw.close(); } catch (IOException e1) { - TPPITweaks.logger.severe("Could not create default changelog!"); + TPPITweaks.logger.severe("Could not create default file" + file.getName() + "!"); e1.printStackTrace(); } } - changelogText = new FileInputStream(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); - - return changelogText; - } - - public static InputStream getSupportedModsFile() - { - supportedMods = TPPITweaks.class.getResourceAsStream("/assets/tppitweaks/lang/" + ConfigurationHandler.supportedModsName + ".txt"); - return supportedMods; + return new FileInputStream(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); } /* From ee4f66c2c5812123f8285062336e4e381d8fea3b Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Thu, 3 Apr 2014 19:06:21 -0400 Subject: [PATCH 09/35] A little more sensible this time. --- src/main/java/tppitweaks/TPPITweaks.java | 48 ++++++++++--------- .../java/tppitweaks/client/gui/GuiHelper.java | 4 +- .../java/tppitweaks/command/CommandTPPI.java | 11 +---- src/main/java/tppitweaks/item/TPPIBook.java | 8 +--- src/main/java/tppitweaks/util/FileLoader.java | 31 ++++++++---- 5 files changed, 53 insertions(+), 49 deletions(-) diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index 560772a..027aa2d 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -40,7 +40,7 @@ public class TPPITweaks @Instance("TPPITweaks") public static TPPITweaks instance; - + @SidedProxy(clientSide = "tppitweaks.proxy.ClientProxy", serverSide = "tppitweaks.proxy.CommonProxy") public static CommonProxy proxy; @@ -50,34 +50,29 @@ public class TPPITweaks public static final Logger logger = Logger.getLogger("TPPITweaks"); public static CreativeTabTPPI creativeTab = new CreativeTabTPPI(CreativeTabs.getNextID()); - + @EventHandler - public void preInit(FMLPreInitializationEvent event) { - - logger.setParent(FMLCommonHandler.instance().getFMLLogger()); + public void preInit(FMLPreInitializationEvent event) + { - ConfigurationHandler.init(new File(event.getModConfigurationDirectory() - .getAbsolutePath() + "/TPPI/TPPITweaks.cfg")); + logger.setParent(FMLCommonHandler.instance().getFMLLogger()); + + ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + "/TPPI/TPPITweaks.cfg")); - try { - FileLoader.init(ConfigurationHandler.cfg, 0); - } catch (IOException e) { - e.printStackTrace(); - } - try { - ConfigurationHandler.loadGuideText(FileLoader.getGuideText()); - ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText()); - CommandTPPI.initValidCommandArguments(FileLoader.getSupportedModsFile()); + FileLoader.init(ConfigurationHandler.cfg, 0); } - catch (FileNotFoundException e) + catch (IOException e) { - logger.severe("IO error while loading TPPITweaks, make sure nothing in the config folder is actively open and Minecraft has permission to read those files!"); e.printStackTrace(); - throw new RuntimeException("IO Error in TPPITweaks file loading!"); } + ConfigurationHandler.loadGuideText(FileLoader.getGuideText()); + ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText()); + + CommandTPPI.initValidCommandArguments(FileLoader.getSupportedModsFile()); + ModItems.initItems(); ModBlocks.initBlocks(); @@ -89,13 +84,13 @@ public void preInit(FMLPreInitializationEvent event) { @EventHandler public void init(FMLInitializationEvent event) { - //AM2SpawnControls.doAM2SpawnControls(); + // AM2SpawnControls.doAM2SpawnControls(); eventHandler = new TPPIEventHandler(); MinecraftForge.EVENT_BUS.register(eventHandler); ModItems.registerRecipes(); ModBlocks.registerRecipes(); - + if (event.getSide().isClient()) proxy.initTickHandler(); } @@ -104,10 +99,17 @@ public void init(FMLInitializationEvent event) public void postInit(FMLPostInitializationEvent event) { RecipeTweaks.doPostInitRecipeTweaks(); - + if (FMLCommonHandler.instance().getSide().isClient()) { - GuiHelper.initMap(); + try + { + GuiHelper.initMap(); + } + catch (FileNotFoundException e) + { + e.printStackTrace(); + } } } diff --git a/src/main/java/tppitweaks/client/gui/GuiHelper.java b/src/main/java/tppitweaks/client/gui/GuiHelper.java index 6771561..5a414a4 100644 --- a/src/main/java/tppitweaks/client/gui/GuiHelper.java +++ b/src/main/java/tppitweaks/client/gui/GuiHelper.java @@ -1,5 +1,7 @@ package tppitweaks.client.gui; +import java.io.FileNotFoundException; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreenBook; import net.minecraft.entity.player.EntityPlayer; @@ -26,7 +28,7 @@ public static void doGuideGUI() Minecraft.getMinecraft().displayGuiScreen(new GuiGuideBase()); } - public static void initMap() + public static void initMap() throws FileNotFoundException { GuiGuideBase.initMap(); } diff --git a/src/main/java/tppitweaks/command/CommandTPPI.java b/src/main/java/tppitweaks/command/CommandTPPI.java index ea290a9..f12ac20 100644 --- a/src/main/java/tppitweaks/command/CommandTPPI.java +++ b/src/main/java/tppitweaks/command/CommandTPPI.java @@ -1,6 +1,5 @@ package tppitweaks.command; -import java.io.FileNotFoundException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; @@ -285,15 +284,7 @@ private void giveModBook(String modName, ICommandSender command) ArrayList pages; - try - { - pages = TxtParser.parseFileMods(FileLoader.getSupportedModsFile(), modName + ", " + properName); - } - catch (FileNotFoundException e) - { - pages = new ArrayList(); - e.printStackTrace(); - } + pages = TxtParser.parseFileMods(FileLoader.getSupportedModsFile(), modName + ", " + properName); if (pages.get(0).startsWith("<") && pages.get(0).endsWith("> ")) { diff --git a/src/main/java/tppitweaks/item/TPPIBook.java b/src/main/java/tppitweaks/item/TPPIBook.java index ef35593..fe841c9 100644 --- a/src/main/java/tppitweaks/item/TPPIBook.java +++ b/src/main/java/tppitweaks/item/TPPIBook.java @@ -1,6 +1,5 @@ package tppitweaks.item; -import java.io.FileNotFoundException; import java.util.List; import net.minecraft.client.renderer.texture.IconRegister; @@ -109,12 +108,7 @@ public ItemStack addTextToBook(ItemStack book, int damage) if (ConfigurationHandler.changelog == null) { - try { - ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText()); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText()); } for (int i = 0; i < ConfigurationHandler.changelog.size(); i++) diff --git a/src/main/java/tppitweaks/util/FileLoader.java b/src/main/java/tppitweaks/util/FileLoader.java index 114f557..8aad20c 100644 --- a/src/main/java/tppitweaks/util/FileLoader.java +++ b/src/main/java/tppitweaks/util/FileLoader.java @@ -177,25 +177,25 @@ public static String manuallyGetConfigValue(Map m, String string return ""; } - public static InputStream getGuideText() throws FileNotFoundException + public static InputStream getGuideText() { - bookText = getFileSafe(new File(ConfigurationHandler.cfg.getParent() + "BookText.txt")); + bookText = loadFile(new File(ConfigurationHandler.cfg.getParent() + "BookText.txt")); return bookText; } - public static InputStream getChangelogText() throws FileNotFoundException + public static InputStream getChangelogText() { - changelogText = getFileSafe(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); + changelogText = loadFile(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); return changelogText; } - public static InputStream getSupportedModsFile() throws FileNotFoundException + public static InputStream getSupportedModsFile() { - supportedMods = getFileSafe(new File(ConfigurationHandler.cfg.getParent() + "/" + ConfigurationHandler.supportedModsName + ".txt")); + supportedMods = loadFile(new File(ConfigurationHandler.cfg.getParent() + "/" + ConfigurationHandler.supportedModsName + ".txt")); return supportedMods; } - private static InputStream getFileSafe(File file) throws FileNotFoundException + private static InputStream loadFile(File file) { if (!file.exists()) { @@ -213,7 +213,22 @@ private static InputStream getFileSafe(File file) throws FileNotFoundException } } - return new FileInputStream(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); + try + { + return new FileInputStream(file); + } + catch (FileNotFoundException e) + { + IOErr(file.getName(), e); + return null; + } + } + + private static void IOErr(String filename, IOException e) + { + TPPITweaks.logger.severe("IO error while loading TPPITweaks, make sure nothing in the config folder is actively open and Minecraft has permission to read those files!"); + e.printStackTrace(); + throw new RuntimeException("IO Error in TPPITweaks file loading, file: " + filename); } /* From d5e16b1cadd545d560f2fa673a861ba9bc552ba7 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Thu, 3 Apr 2014 23:01:30 -0400 Subject: [PATCH 10/35] Add JABBA and Unifier recipes, still needs work. --- src/main/java/tppitweaks/TPPITweaks.java | 1 - .../config/ConfigurationHandler.java | 6 +++- src/main/java/tppitweaks/item/ModItems.java | 2 +- src/main/java/tppitweaks/lib/Reference.java | 5 +++- .../tppitweaks/recipetweaks/RecipeTweaks.java | 21 ++++++++++++- .../recipetweaks/modTweaks/JABBATweaks.java | 30 +++++++++++++++++++ .../recipetweaks/modTweaks/MFRTweaks.java | 29 ++++++++++++++++++ 7 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java create mode 100644 src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index 027aa2d..43775c6 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -54,7 +54,6 @@ public class TPPITweaks @EventHandler public void preInit(FMLPreInitializationEvent event) { - logger.setParent(FMLCommonHandler.instance().getFMLLogger()); ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + "/TPPI/TPPITweaks.cfg")); diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 5fa354a..ec766c6 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -39,7 +39,9 @@ public class ConfigurationHandler public static boolean tweakDA; public static boolean tweakSFM; public static boolean tweakAM2; - + public static boolean tweakJABBA; + public static boolean buffUnifierRecipe; + public static boolean disableAGAutoOutputter; public static boolean fixExURecipes; @@ -129,6 +131,8 @@ public static void init(File file) removeStupidEnergyCrystalRecipe = config.get("Other Mod Tweaks", "removeDartCraftEnergyCrystalRecipe", true, "Remove DartCraft's IC2 energy crystal recipe.").getBoolean(true); disableForceShears = config.get("Other Mod Tweaks", "disableForceShears", true, "Remove the force shears recipe because they were crashing servers rarely, but in a serious way. Disable this at your own risk.").getBoolean(true); disableAGAutoOutputter = config.get("Other Mod Tweaks", "disableAGAutoOutputter", true, "Remove the recipe for the Advanced Genetics auto output upgrade, because crashes.").getBoolean(true); + tweakJABBA = config.get("Other Mod Tweaks", "tweakJABBA", "Alter the JABBA barrel recipe to be a little more complicated, leaving FZ barrels as a \"low-tech\" option").getBoolean(true); + buffUnifierRecipe = config.get("Other Mod Tweaks", "buffUnifierRecipe", true, "Make the unifier cheaper.").getBoolean(true); fixExURecipes = config.get("ExtraUtils Tweaks", "fixExtraUtilsRecipes", true, "Current version of ExU has broken recipes for the unstable ingot block. This fixes that.").getBoolean(true); nerfEnderQuarry = config.get("ExtraUtils Tweaks", "nerfEnderQuarry", true, "Make the Extra Utilities ender quarry expensive.").getBoolean(true); diff --git a/src/main/java/tppitweaks/item/ModItems.java b/src/main/java/tppitweaks/item/ModItems.java index ad28468..96a36ef 100644 --- a/src/main/java/tppitweaks/item/ModItems.java +++ b/src/main/java/tppitweaks/item/ModItems.java @@ -30,7 +30,7 @@ public static void initItems() { public static void registerRecipes() { GameRegistry.addShapelessRecipe(tppiBook.getGuide(), Item.ingotIron, Item.paper, Item.paper, Item.paper); - + if(Loader.isModLoaded("AppliedEnergistics") && Loader.isModLoaded("StevesFactoryManager") && ConfigurationHandler.tweakSFM) { GameRegistry.addRecipe(new ItemStack(tppiMaterial.itemID, 1, 1), new Object[] { diff --git a/src/main/java/tppitweaks/lib/Reference.java b/src/main/java/tppitweaks/lib/Reference.java index 402f615..3abb2a4 100644 --- a/src/main/java/tppitweaks/lib/Reference.java +++ b/src/main/java/tppitweaks/lib/Reference.java @@ -39,7 +39,10 @@ public class Reference + "required-after:NotEnoughItems;" + "after:Railcraft;" + "after:advancedgenetics;" - + "after:IC2"; + + "after:IC2;" + + "after:factorization;" + + "after:MineFactoryReloaded;" + + "after:JABBA"; public static String packName = "Test Pack Please Ignore"; public static String packVersion = "0.2.2"; diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java index 8952aab..c8ded86 100644 --- a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java @@ -21,6 +21,8 @@ import tppitweaks.recipetweaks.modTweaks.ExUTweaks; import tppitweaks.recipetweaks.modTweaks.GregtechTweaks; import tppitweaks.recipetweaks.modTweaks.IC2Tweaks; +import tppitweaks.recipetweaks.modTweaks.JABBATweaks; +import tppitweaks.recipetweaks.modTweaks.MFRTweaks; import tppitweaks.recipetweaks.modTweaks.MPSATweaks; import tppitweaks.recipetweaks.modTweaks.MagicropsAndIC2Tweaks; import tppitweaks.recipetweaks.modTweaks.MagicropsAndTETweaks; @@ -57,6 +59,8 @@ public class RecipeTweaks private static boolean okayToTweakReliquary; private static boolean okayToTweakAdvancedGenetics; private static boolean okayToTweakRailcraft; + private static boolean okayToTweakJABBA; + private static boolean okayToTweakMFR; public static void doPostInitRecipeTweaks() { @@ -140,6 +144,8 @@ private static void checkWhatWeCanTweak() okayToTweakReliquary = Loader.isModLoaded("xreliquary") && ConfigurationHandler.harderLillipadRecipe; okayToTweakAdvancedGenetics = Loader.isModLoaded("advancedgenetics"); okayToTweakRailcraft = Loader.isModLoaded("Railcraft"); + okayToTweakJABBA = ConfigurationHandler.tweakJABBA && Loader.isModLoaded("factorization") && Loader.isModLoaded("MineFactoryReloaded") && Loader.isModLoaded("JABBA"); + okayToTweakMFR = ConfigurationHandler.buffUnifierRecipe && Loader.isModLoaded("MineFactoryReloaded"); } private static void initRemovableRecipesMap() @@ -205,6 +211,14 @@ private static void initRemovableRecipesMap() { ReliquaryTweaks.init(); } + if (okayToTweakJABBA) + { + JABBATweaks.init(); + } + if (okayToTweakMFR) + { + MFRTweaks.init(); + } } private static boolean canRemoveRecipe(IRecipe r) @@ -223,7 +237,6 @@ private static boolean canRemoveRecipe(IRecipe r) private static void addRevisedRecipes() { - if (okayToTweakEnderStorage) EnderStorageTweaks.addRecipes(); @@ -266,6 +279,12 @@ private static void addRevisedRecipes() if (okayToTweakExU) ExUTweaks.addRecipes(); + if (okayToTweakJABBA) + JABBATweaks.addRecipes(); + + if (okayToTweakMFR) + MFRTweaks.addRecipes(); + GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java new file mode 100644 index 0000000..83b28f6 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -0,0 +1,30 @@ +package tppitweaks.recipetweaks.modTweaks; + +import mcp.mobius.betterbarrels.BetterBarrels; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import powercrystals.minefactoryreloaded.setup.Machine; +import cpw.mods.fml.common.registry.GameRegistry; +import factorization.shared.Core; + +public class JABBATweaks +{ + public static void init() + { + TweakerBase.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); + } + + public static void addRecipes() + { + // This only works for oak barrels + GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, + "wBw", + "wUw", + "www", + + 'w', "plankWood", + 'B', new ItemStack(Core.registry.daybarrel, 1, 2720), + 'U', Machine.Unifier.getItemStack() + )); + } +} diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java new file mode 100644 index 0000000..e7cb602 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -0,0 +1,29 @@ +package tppitweaks.recipetweaks.modTweaks; + +import net.minecraft.item.Item; +import net.minecraftforge.oredict.ShapedOreRecipe; +import powercrystals.minefactoryreloaded.MineFactoryReloadedCore; +import powercrystals.minefactoryreloaded.setup.Machine; +import cpw.mods.fml.common.registry.GameRegistry; + +public class MFRTweaks +{ + public static void init() + { + TweakerBase.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); + } + + public static void addRecipes() + { + GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), + "RRR", + "rCr", + " M ", + + 'R', "sheetPlastic", + 'r', Item.redstone, + 'C', Item.comparator, + 'M', MineFactoryReloadedCore.machineBaseItem + )); + } +} From a5620bbff2e1dca21d0711b694e60ab341d50746 Mon Sep 17 00:00:00 2001 From: wha-ha-ha Date: Fri, 4 Apr 2014 02:13:24 -0400 Subject: [PATCH 11/35] JABBA barrels now craftable from any type of FZ barrel! --- .../java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java index 83b28f6..3fbe70d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -2,6 +2,7 @@ import mcp.mobius.betterbarrels.BetterBarrels; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.setup.Machine; import cpw.mods.fml.common.registry.GameRegistry; @@ -23,7 +24,7 @@ public static void addRecipes() "www", 'w', "plankWood", - 'B', new ItemStack(Core.registry.daybarrel, 1, 2720), + 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), 'U', Machine.Unifier.getItemStack() )); } From f7d73c6fc1a922f68cb0d8b749bc9c6d8255b1de Mon Sep 17 00:00:00 2001 From: wha-ha-ha Date: Fri, 4 Apr 2014 14:25:59 -0400 Subject: [PATCH 12/35] Made the unifier actually craftable in TPPI :P --- .../tppitweaks/recipetweaks/modTweaks/MFRTweaks.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index e7cb602..93e8d42 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -1,6 +1,7 @@ package tppitweaks.recipetweaks.modTweaks; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.MineFactoryReloadedCore; import powercrystals.minefactoryreloaded.setup.Machine; @@ -15,6 +16,14 @@ public static void init() public static void addRecipes() { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), + "RRR", + "SSS", + + 'R', "sheetPlastic", + 'S', "stone" + )); + GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), "RRR", "rCr", From 783b2edc79e2c2b4a09531f0e4c3419353ece421 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 4 Apr 2014 15:37:09 -0400 Subject: [PATCH 13/35] Add "/" >.> --- src/main/java/tppitweaks/util/FileLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/util/FileLoader.java b/src/main/java/tppitweaks/util/FileLoader.java index 8aad20c..cafdff0 100644 --- a/src/main/java/tppitweaks/util/FileLoader.java +++ b/src/main/java/tppitweaks/util/FileLoader.java @@ -179,7 +179,7 @@ public static String manuallyGetConfigValue(Map m, String string public static InputStream getGuideText() { - bookText = loadFile(new File(ConfigurationHandler.cfg.getParent() + "BookText.txt")); + bookText = loadFile(new File(ConfigurationHandler.cfg.getParent() + "/BookText.txt")); return bookText; } From 6554c9f0694491094478be578451f38aed86238b Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 4 Apr 2014 21:30:15 -0400 Subject: [PATCH 14/35] Unregister Fused Quartz and buff some EIO recipes. Suggestions welcome. --- src/main/java/tppitweaks/TPPITweaks.java | 3 + .../config/ConfigurationHandler.java | 6 +- src/main/java/tppitweaks/lib/Reference.java | 3 +- .../tppitweaks/recipetweaks/RecipeTweaks.java | 60 +- .../recipetweaks/modTweaks/EnderIOTweaks.java | 47 + .../assets/tppitweaks/lang/BookText.txt | 80 -- .../assets/tppitweaks/lang/SupportedMods.txt | 1030 ----------------- 7 files changed, 95 insertions(+), 1134 deletions(-) create mode 100644 src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java delete mode 100644 src/main/resources/assets/tppitweaks/lang/BookText.txt delete mode 100644 src/main/resources/assets/tppitweaks/lang/SupportedMods.txt diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index 43775c6..bed06ca 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -83,6 +83,9 @@ public void preInit(FMLPreInitializationEvent event) @EventHandler public void init(FMLInitializationEvent event) { + if (ConfigurationHandler.unregisterFusedQuartz) + RecipeTweaks.fixFusedQuartz(); + // AM2SpawnControls.doAM2SpawnControls(); eventHandler = new TPPIEventHandler(); diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index ec766c6..815a079 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -59,7 +59,9 @@ public class ConfigurationHandler public static boolean unnerfPaperRecipe; public static boolean readdResinSmelting; public static boolean doCharcoalBlockCompression; - + public static boolean makeEIOHardModeEasier; + public static boolean unregisterFusedQuartz; + public static boolean addEssenceSeedRecipe; public static boolean harderActivatorRecipe; @@ -133,6 +135,8 @@ public static void init(File file) disableAGAutoOutputter = config.get("Other Mod Tweaks", "disableAGAutoOutputter", true, "Remove the recipe for the Advanced Genetics auto output upgrade, because crashes.").getBoolean(true); tweakJABBA = config.get("Other Mod Tweaks", "tweakJABBA", "Alter the JABBA barrel recipe to be a little more complicated, leaving FZ barrels as a \"low-tech\" option").getBoolean(true); buffUnifierRecipe = config.get("Other Mod Tweaks", "buffUnifierRecipe", true, "Make the unifier cheaper.").getBoolean(true); + makeEIOHardModeEasier = config.get("Other Mod Tweaks", "makeEnderIOHardModeEasier", true, "Give some EnderIO recipes a buff as they are way too diffucult. Currently affects: basic capacitor, reservoir").getBoolean(true); + unregisterFusedQuartz = config.get("Other Mod Tweaks", "unregisterFusedQuartz", true, "Having fused quartz be registered under hardened glass doesn't make much sense. This fixes that.").getBoolean(true); fixExURecipes = config.get("ExtraUtils Tweaks", "fixExtraUtilsRecipes", true, "Current version of ExU has broken recipes for the unstable ingot block. This fixes that.").getBoolean(true); nerfEnderQuarry = config.get("ExtraUtils Tweaks", "nerfEnderQuarry", true, "Make the Extra Utilities ender quarry expensive.").getBoolean(true); diff --git a/src/main/java/tppitweaks/lib/Reference.java b/src/main/java/tppitweaks/lib/Reference.java index 3abb2a4..c01e957 100644 --- a/src/main/java/tppitweaks/lib/Reference.java +++ b/src/main/java/tppitweaks/lib/Reference.java @@ -42,7 +42,8 @@ public class Reference + "after:IC2;" + "after:factorization;" + "after:MineFactoryReloaded;" - + "after:JABBA"; + + "after:JABBA;" + + "after:EnderIO"; public static String packName = "Test Pack Please Ignore"; public static String packVersion = "0.2.2"; diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java index c8ded86..d51470a 100644 --- a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java @@ -1,5 +1,8 @@ package tppitweaks.recipetweaks; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.ListIterator; @@ -11,29 +14,9 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; +import tppitweaks.TPPITweaks; import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.modTweaks.AM2Tweaks; -import tppitweaks.recipetweaks.modTweaks.AdvancedGeneticsTweaks; -import tppitweaks.recipetweaks.modTweaks.BigReactorsTweaks; -import tppitweaks.recipetweaks.modTweaks.DATweaks; -import tppitweaks.recipetweaks.modTweaks.DCTweaks; -import tppitweaks.recipetweaks.modTweaks.EnderStorageTweaks; -import tppitweaks.recipetweaks.modTweaks.ExUTweaks; -import tppitweaks.recipetweaks.modTweaks.GregtechTweaks; -import tppitweaks.recipetweaks.modTweaks.IC2Tweaks; -import tppitweaks.recipetweaks.modTweaks.JABBATweaks; -import tppitweaks.recipetweaks.modTweaks.MFRTweaks; -import tppitweaks.recipetweaks.modTweaks.MPSATweaks; -import tppitweaks.recipetweaks.modTweaks.MagicropsAndIC2Tweaks; -import tppitweaks.recipetweaks.modTweaks.MagicropsAndTETweaks; -import tppitweaks.recipetweaks.modTweaks.MagicropsTweaks; -import tppitweaks.recipetweaks.modTweaks.MekanismTweaks; -import tppitweaks.recipetweaks.modTweaks.OpenBlocksTweaks; -import tppitweaks.recipetweaks.modTweaks.RailcraftTweaks; -import tppitweaks.recipetweaks.modTweaks.ReliquaryTweaks; -import tppitweaks.recipetweaks.modTweaks.SFMTweaks; -import tppitweaks.recipetweaks.modTweaks.TETweaks; -import tppitweaks.recipetweaks.modTweaks.TweakerBase; +import tppitweaks.recipetweaks.modTweaks.*; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; @@ -61,6 +44,7 @@ public class RecipeTweaks private static boolean okayToTweakRailcraft; private static boolean okayToTweakJABBA; private static boolean okayToTweakMFR; + private static boolean okayToTweakEnderIO; public static void doPostInitRecipeTweaks() { @@ -146,6 +130,7 @@ private static void checkWhatWeCanTweak() okayToTweakRailcraft = Loader.isModLoaded("Railcraft"); okayToTweakJABBA = ConfigurationHandler.tweakJABBA && Loader.isModLoaded("factorization") && Loader.isModLoaded("MineFactoryReloaded") && Loader.isModLoaded("JABBA"); okayToTweakMFR = ConfigurationHandler.buffUnifierRecipe && Loader.isModLoaded("MineFactoryReloaded"); + okayToTweakEnderIO = Loader.isModLoaded("EnderIO"); } private static void initRemovableRecipesMap() @@ -219,6 +204,10 @@ private static void initRemovableRecipesMap() { MFRTweaks.init(); } + if (okayToTweakEnderIO) + { + EnderIOTweaks.init(); + } } private static boolean canRemoveRecipe(IRecipe r) @@ -285,6 +274,9 @@ private static void addRevisedRecipes() if (okayToTweakMFR) MFRTweaks.addRecipes(); + if (okayToTweakEnderIO) + EnderIOTweaks.addRecipes(); + GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); } @@ -306,4 +298,28 @@ private static void doOreDictTweaks() FurnaceRecipes.smelting().addSmelting(newStack.itemID, newStack.getItemDamage(), stack1.copy(), 0.1F); } } + + @SuppressWarnings("unchecked") + public static void fixFusedQuartz() + { + try + { + int id = OreDictionary.getOreID("glassHardened"); + Field f = OreDictionary.class.getDeclaredField("oreStacks"); + f.setAccessible(true); + HashMap> temp = (HashMap>) f.get(null); + ArrayList glasses = (ArrayList) temp.get(id).clone(); + for (int i = 0; i < glasses.size(); i++) + if (glasses.get(i).getUnlocalizedName().toLowerCase().contains("fused")) + glasses.remove(i); + temp.remove(id); + temp.put(id, glasses); + f.set(null, temp); + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Fixing EnderIO via reflection failed!"); + t.printStackTrace(); + } + } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java new file mode 100644 index 0000000..79a458c --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java @@ -0,0 +1,47 @@ +package tppitweaks.recipetweaks.modTweaks; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import tppitweaks.config.ConfigurationHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import crazypants.enderio.Config; +import crazypants.enderio.EnderIO; + +public class EnderIOTweaks +{ + public static void init() + { + if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) + { + TweakerBase.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); + TweakerBase.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); + } + } + + public static void addRecipes() + { + if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) + { + GameRegistry.addRecipe(new ItemStack(EnderIO.blockReservoir), + "GGG", + "QcQ", + "GGG", + + 'G', new ItemStack(EnderIO.blockFusedQuartz, 1, 1), + 'Q', new ItemStack(EnderIO.blockFusedQuartz), + 'c', Item.cauldron + ); + + GameRegistry.addRecipe(new ShapedOreRecipe(EnderIO.itemBasicCapacitor, + " CR", + "CGC", + "RC ", + + 'C', "ingotCopper", + 'R', "dustRedstone", + 'G', "ingotGold" + )); + } + } +} diff --git a/src/main/resources/assets/tppitweaks/lang/BookText.txt b/src/main/resources/assets/tppitweaks/lang/BookText.txt deleted file mode 100644 index 7114135..0000000 --- a/src/main/resources/assets/tppitweaks/lang/BookText.txt +++ /dev/null @@ -1,80 +0,0 @@ -**This is the file that TPPI Tweaks reads its info from, it is used for changelogs and information on the modpack** -**To add to the file, type what you want, and separate pages by using the phrase ~~~ ** -**The code will interpret "~~~" as a page break, and format the book accordingly** -**In addition, adding a "~" to the end of a line will add a line break** -**Two asterisks at the beginning of a line is a comment** -**Three asterisks and a number will skip that amount of lines following** - -***12 -Example: -This is some very useful info -And I am typing it on multiple lines -to make this text file easier to read. -These lines don't have line breaks between them -in the book though because they don't end with "~". -~~~ -Now I am on page 2~ -Now I am one line down~ -~ -Now I am after a blank line - -**Begin book text after asterisks** -**************************************************************************** -Greetings everyone, and welcome to Test Pack Please Ignore!~ -~ -~ -We're really excited to bring this pack to you all. -~~~ -We also couldn't have done so without the Feed The Beast subreddit community, -who the pack is made by and for.~ -~ -Thank you all so very much for making TPPI possible! -~~~ -This book you're reading is added by our own custom mod, TPPI Tweaks.~ -~ -It will always automatically contain the most up-to-date information -on the pack, so check it often!~ -~ -Should you want a new copy, you can craft one with an iron ingot and three paper, -but this is not necessary to recieve new info!. -~~~ -Another feature of TPPI Tweaks is the in-game commands it adds.~ -~ -The changelog can be found by typing /tppi changelog, which will of course always -be up to date, no need to ever get a new copy.~ -~ -We're also working on a project to add in-game documentation for all -the mods in the pack, to be accessed via commands.~ -~~~ -Type /tppi guide to receive an all-around guide to the documentation system, -the easiest way to obtain info on any mod you wish.~ -~~~ -Type /tppi mods to get an individual book for a mod, or to get -a link if the mod has not had in-game documentation written for it yet.~ -/tppi mods list will give you a list of all mods that are possible to be used in the command. -~~~ -Naturally, this is a big job, and it's not yet finished. -~ -It is our hope that the community will get -involved in documenting these mods via our mod's system.~ -~ -If you'd like to help out with this documentation project or any other parts of TPPI's -development, feel free to type the command /tppi getInvolved to learn more. -~~~ -Lastly, the /tppi ores command will give you a book on TPPI's unique layer-based -ore generation system.~ -~ -Judge has worked very hard on it, and we're very happy that almost everyone sees it as a good change. -~~~ -That's about it. Have fun!~ -~ -~ -~ -~ -~ -~ -~ -~ -~ - Love,~ - -The Dev Team diff --git a/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt b/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt deleted file mode 100644 index c277d2c..0000000 --- a/src/main/resources/assets/tppitweaks/lang/SupportedMods.txt +++ /dev/null @@ -1,1030 +0,0 @@ -**This is the file of supported mods and the info to go along with them** -**To add a mod to the file, type >ModCommandName, ModProperName<** -**The ModCommandName cannot have spaces, and will be used to call the mod's info command.** -**The ModProperName can have spaces - this is the "real name" of the mod, to be used in its guidebook title.** -**Example: >ThermalExpansion, Thermal Expansion 3<** -**After that, type any info about the mod. Mod information is naturally separated by the names of mods (inside ><)** -**To just specify a link, use <> (ex. ) and this will be put into the chat instead of a book** -**You CANNOT have a mod's documentation be both a book and a link, due to current limitations of the mod** -**That means, for mods where you want to link to a wiki, the link should be all that's there under it in this** -**documentation file.** -**The code will interpret "~~~" as a page break, and format the book accordingly** -**In addition, adding a "~" to the end of a line will add a line break** -**Two asterisks at the beginning of a line is a comment** -**Three asterisks and a number will skip that amount of lines following** - - -**Linked means there is a link to the wiki/website, but I (gr8pefish) still want to document it in-game if I have time** -**Incomplete means there is some documentation, but not as much as I would like** -**If you alter this code please update this to-do. Or if you are working on one, put your name next to it. Thanks!** -**TO DO:** -**additional builcraft objects** -**applied energistics [Linked]** -**bibliocraft [Linked]** -**big reactors [Linked]** -**blood magic [Linked]** -**buildcraft [Incomplete]** -**computercraft [Linked]** -**engineers toolbox [Linked]** -**extra cells [Linked]** -**extra bees** -**extra trees** -**factorization [Linked]** -**forestry-machines [Linked]** -**forestry-bees [Linked]** -**forestry-trees [Linked]** -**gregtech? [linked] (Maybe just a basics guide?)** -**hardcore ender expansion [Linked]** -**industrial craft [Burn477?] (posted in r/TPPI)** -**logistics pipes [Linked]** -**magical crops [Linked]** -**mekanism [Linked]** -**MFFS [Linked]** -**MPS [Linked]** -**MPSA [Linked]** -**MystCraft-WritingAges [Linked]** -**MystCraft-General [Linked]** -**Nuclear control [Linked]** -**Open blocks** -**portal gun [Linked]** -**project red [Linked]** -**quarry plus** -**railcraft-rails [Linked]** -**railcraft-other [Linked]** -**redstone arsenal [Incomplete]** -**reliquary {Linked}** -**steve's carts [Linked]** -**steve's factory manager [Linked]** -**thermal expansion (incomplete)** -**twilight forest [Linked]** -**witchery [Incomplete?]** - - -***15 -Example: ->ModName< -This is some very useful info -and I am typing it on multiple lines -to make this text file easier to read. -These lines don't have line breaks between them -in the book though because they don't end with "~". -~~~ -Now I am on page 2~ -Now I am one line down~ -~ -Now I am after a blank line ->ModName2< - - -**Begin line after asterisks** -**************************************************************************** -**>AdditionalBuildcraftObjects, Additional Buildcraft Objects<** - ->AdvancedSolarPanels, Advanced Solar Panels< -Advanced Solar Panels is an addon for Industrial Craft 2 (IC2). It only adds a couple of blocks, and they are mostly -solar panels that deliver high output for a very high initial material cost.~ -~ -The advanced solar panel generates 8 eu/t in daytime, 1 eu/t at night~ -The hybrid solar panel generates 64 eu/t in daytime, 8 eu/t at night~ -The ultimate hybrid solar panel generates 512 eu/t in daytime, 64 eu/t at night~ -~ -The mollecular assembler converts items into better versions of themselves for a high energy cost. For example, 1 Glowstone -becomes 1 Sunnarium (needed for the ultimate hybrid solar panel) with the input of 9,000,000 EU. THis machine can accept -any amount of energy, and any number of packets of energy (i.e. It won't explode). - ->AppliedEnergistics, Applied Energistics< - - ->ArsMagica, Ars Magica 2< -Ars Magica 2 is a magical mod with RPG elements. Think mana, spellcasting, levelling up, and fighting fearsome enemies!~ -~ -It's worth noting that, due to our having had to disable Dryads in TPPI, Nature Guardians must be summoned from their spawn eggs, which we've added a crafting recipe for. -~~~ -Other than that, check out the mod's own in-game guide!~ -~ -To get it, craft an Item Frame and -a normal Book, and get exploring!~ -~ -You'll have to find liquid Essence; a cyan liquid found in pools in forests and similar biomes.~ -~~~ -Once you've found an essence pool, place the Item Frame so that it is directly above -the pool of Essence, and place the Book inside the Item Frame.~ -~ -After some flashes and sparkles, your guidebook will be ready! -~~~ -If you find the book confusing, the first things you should craft to unlock the rest of the mod would be the -oculus, inscription table, and crafting alter, respectively.~ -~ -After doing that, the rest of the mod is yours to explore! - - ->BiblioCraft, BiblioCraft< - -**Will document fully when I have time** - ->BigReactors, Big Reactors< - - ->BiomesOPlenty, Biomes O Plenty< -Biomes O' Plenty (BOP) adds a large number of biomes to the world generation. It is also highly configurable; you can adjust which -biomes appear as well as adjust the landmass perecentage, village rarity and more.~ -~ -BOP also adds another Dimension, called "The Promised Land," which can be found by combining end stone and various ores -found in differnt biomes. The gems and their biome locations are as follows:~ -~ -Emerald: Forest/Mountain type biomes~ -Ruby: Desert type biomes~ -Peridot: Grassland type biomes~ -Topaz: Jungle/Tropical type biomes~ -Tanzanite: Snow type biomes~ -Apatite: Swamp type biomes - - ->BloodMagic, Blood Magic< - - -**Split into silicon, transport, etc? ->Buildcraft, Buildcraft 4< -Buildcraft adds a load of cool ways to automate crafting, processing, and mining.~ -~ -This mod adds "engines" which are ways to produce MJ. You can also use Thermal Expansion's dynamos, -but you must have an energy conduit between the dynamo and the machine.~ -~ -There are many different machines, for instance, the quarry. The quarry is an semi-automatic way to mine. You can use -landmarks to set the size of the quarry, but keep in mind 64x64 is the maximum size. Apply a redstone signal to landmarks -to see a red line extending for 64 blocks. The automatic crafting table crafts stuff, automatically! Totally unexpected! -~ -You can also use pipes to transport items, for instance you can make a automated smelter. If you want to learn better, -just start practicing and you'll get the hang of it, or you can watch a mod spotlight. -~ - ->BuildcraftAddon, Buildcraft Addon< -Buildcraft Addon adds only 3 items.~ -~ -The stair placer places stairs from your inventory into the world, similiar to the Builder's wand from Extra Utilities, -except this only works with stairs.~ -~ -The color selector and color sorter act as an addition to buildcraft transport's item coloring system. It acts as an improved -lazuli transport pipe in that it will color items to be sorted by the dazuli transport pipe. The color selector allows the user -to set multiple ghost items in it's GUI (accessed by right clicking) and then select the color the items will be colored to. -It requires a small amount of power to operate. It is very similar to Red Power 2's sorter.~ -The color selector lets you easily color a pipe as well. Right click it (while not pointing at anything) to open the GUI. - ->CarpentersBlocks, Carpenter's Blocks< -Carpenter's Blocks adds wooden frames of vanilla items that can be textured with other blocks to change the appearance.~ -~ -This mod is mainly used for aesthetic purposes.~ -~ -There are two tools in addition to the blocks added, the "Carpenter's Hammer" and the "Carpenter's Chisel". These are used -to alter the carpenter's blocks. -~~~ -Basics~ -~ -Once a Carpenter's block is placed in the world, right-click it with any full-size block (except TileEntities: chests, -machines, etc.) If the block is compatible, it will take on the appearance of the placed block and also any properties -of it (fire-resistance, explosion-resistance, etc.) To remove the block used for texturing shift left-click with the -carpenter's hammer. To alter the appearance further left/right click with the chisel to cycle through additional -patterns.~ -~ -In general, left-clicking a carpenter's block with the hammer will re-orient it (turn it left/right) while right-clicking -will change the block (ex: stairs -> corner stairs -> upside-down stairs -> etc.) -~~~ -Additionally, once a carpenter's block has an overlayed appearance another block can be placed on any side to create a -cover on the block. These can be altered indepently of the main block.~ -~ -Some items can be used as overlays even though they are not full blocks. These include: seeds, snowballs, vines, string, -wheat and mushrooms.~ -~ -All 16 dyes can be used to color a carpenter's blocks. This affects existing overlays, so placing dirt on a carpenter's -block and then putting purple dye on that will yield purple dirt! Also, the "chisel" mod plays nicely with this mod, so -many overlays are possible with that in mind.~ -~ -Since there are only a handful of blocks the following pages will describe the specifics on each block if special features -exist. -~~~ -Carpenter's Block~ -~ -Left/Right click with the hammer to change the block into a slab. The direction you hit the block changes the orientation -of the slab. -~~~ -Carpenter's Slope~ -~ -This block is amazing. Remember that right clicking with a hammer will change the block (It has many options, try them out!) -while left-clicking will re-orient the block. -~~~ -Carpenter's Door/Hatch~ -~ -Right clicking with the hammer will change the appearance while left-clicking will make the door/hatch open to either the right -or the left (or in the hatch's case the top or the bottom as well). Shift right-clicking will make it behave like either -an iron door or a wooden door (default). Also, if you have two carpenter's doors side by side, opening/closing one will -make both open/close! -~~~ -Carpenter's Bed~ -~ -Right/Left clicking with the hammer will change the appearance of the bed-sheets/pillow to a few built in patterns. You can -still texture the frame of the bed (note it is two blocks so you will need two dye). Shift right-clicking will restore -the bed's pattern to default. -~~~ -Carpenter's Button/Lever/Pressure Plate~ -~ -Left clicking with the hammer will invert the redstone output. For the pressure plate right clicking with the hammer will -cycle through triggers so that the pressure plate will only be activated by mobs, animals, players, or everyone. -~~~ -Carpenter's Collapsible Block~ -~ -This block is affected by left clicking any corner of the block with the hammer, as the corner selected will depress by -one pixel (to a maximum of only one pixel left). Right-clicking raises it by one pixel. Only the top of the block will -compress this way, trying to make a roof out of these blocks is not a good idea. -~~~ -Carpenter's Barrier/Gate~ -~ -Right clicking with the hammer will rotate between a few textures. Shift right clicking while on the default fence will -alter the size of the gap in the fence by one pixel. -~~~ -Carpenter's Daylight Sensor~ -~ -Left clicking with a hammer will invert the redstone output. Left clicking will cycle between activating for sunset/sunrise -or when light levels are low enough for monsters to spawn. -~~~ -Carpenter's Ladder~ -~ -The only thing special about this block is that it can be free-floating (It acts as it's own block and doesn't have to -be placed on a wall). -~~~ -Carpenter's Safe~ -~ -Similar to the strongbox from Thermal Expansion, this item is linked to the user. Sneak right click with the hammer to -lock/unlock the safe so others can access it. Right click with the hammer to change automation rules (extraction is -allowed, not allowed, etc.)~ -~ -The green/red light indicates if the safe is unlocked/locked respectively. The blue bar indicates how full the safe is. -Holding a gold ingot and right clicking on the safe will upgrade it to 54 slots (double chest's worth). The only way -to get the gold back is to break the safe. -~~~ -Carpenter's Flower Pot~ -~ -Right click with some soil (dirt) to place it in the pot and allow plants to be placed in it. Covers are supprted, but so -are built in patterns (although not both simultaneously). Left/Right click with the hammer to cycle through the patterns. -Sneak right click with the hammer to reset it to default.~ -~ -Most plants can be planted in this flower pot, you are no longer limited to flowers and cacti. Sneak left click with the -hammer to remove the plant and sneak right click to remove the cover. - - ->Chisel, Chisel< -Chisel is a mod that adds decorative blocks to minecraft. It modifies existing blocks by use of a chisel to create -aesthetic blocks similar to the original one.~ -~ -Chisel adds two blocks to world-generation, marble and limestone. They are purely for looks.~ -~ -To get started first craft a chisel with two sticks and an iron ingot (diagonally in a crafting table). There are two ways -to use it, either in-world or in a crafting GUI. -~~~ -To bring up the GUI, right click the chisel while it is in you hotbar. Here you can place the block to modify -in the center. Try it out with cobblestone, stone, dirt or something else that you have on hand. You will notice that -blocks appear on the blank slots to the sides. To chisel the block in the center simply left click on the desired block -that appears on the sides.~ -~ -You can hover over the chiseled blocks to get a more detailed description of each one. Some blocks even have connected -textures! It should also be noted that if you have 32 blocks in the center and you choose a chiseled block all 32 will be -transformed! However, you can chisel an already chiseled block and most chisel recipes will let you use this mechanism to -get the vanilla item back from an existing chiseled block.~ -~~~ -To chisel a block in-game simply left click the block to be altered. Keep left-clicking on the block to cycle through -the available options. NOTE: THIS IS CURRENTLY BUGGED, IT WILL CREATE AN INVISIBLE BLOCK. IT IS RECCOMENDED YOU USE THE -GUI METHOD INSTEAD.~ -~ -There are also some special items that chisel adds:~ -The "Ball O' Moss" creates an Area of effect "explosion" that changes nearbly blocks into mossy versions of them.~ -The "Cloud in a bottle" will spawn a cloud when thrown/broken.~ -~ -Finally, there are additional chisel-able blocks that this mod adds. They can be found in NEI. - - ->ComputerCraft, ComputerCraft< - -**People looking at this book will mostly be new to CC so a link gives them other resources to learning Lua** -**Even though in-game documentation is better, in this case I think they will use the internet anyway** -**Feel free to document it anyway if you have time/want to though!** - ->DamageIndicators, Damge Indicators< -Damage indicators is a small mod that adds a HUD displaying the health of the entity the player is looking at.~ -~ -Additionally, you can adjust the settings by pressing "." - - ->DartCraft, DartCraft< -To get started in Dartcraft you must first find some power ore. It glows bright yellow and is found deep in the earth (or -in the Nether). Use it, alongside some ingots to craft a force ingot and a force nugget. Then craft these along with a stick -in a diagonal to gain a force rod. Right click a bookcase with the force rod to recieve the Book of Mudora, which will have -information on all things Dartcraft. - ->DimensionalAnchors, Dimensional Anchors< -This mod adds in only one block, the dimesional anchor. This block loads chunks (16x16 squares) for the player in order -to make automation possible even if the player is absent.~ -~ -To open the GUI right click the block. The red arrow will decrease the number of loaded chunks while the green arrow will -increase them. - ->EmasherResource, Emashers Resource< -Emasher Resource adds various ores and items to the game. It is meant to be an inclusion to the mod Engineer's Toolbox. -Emasher Resource includes algae, hemp, limestone, red sandstone, and emery ore.~ -~ -Algae can be harvested by hand and when "planted" in water it will spead to every nearby water source block. It can also -be harvested and burned in a photobioreactor to create hydrogen to be burned as an energy source.~ -~ -Hemp can be used for armor, string, paper, cactus green, and hemp seeds. The seeds can be crafted into hemp seed oil -which can be used as a fuel.~ -~ -Limestone can be used to make quicklime which is used in Engineer's Toolbox's ore processing.~ -~ -Emery ore is simply used to make the grinder (Engineer's Toolbox). It is about as rare as diamonds.~ -~ -Red Sandstone is aesthetic? - ->EnderIO, EnderIO< -Ender IO adds compact liquid conduits, energy conduits and redstone conduits, power generation, machinery, remote area -access, and more. This mod is similar to Thermal Expansion; it supports RF and MJ.~ -~~~ -Machines~ -~ -All Machines consume power (MJ, the bar on the left side of the GUI) and can be upgraded with capacitors to increase their -energy storage (and their speed/energy consumption)~ -~ -SAG Mill~ -This item acts as a pulverizer/macerator, grinding ores into dusts to increase output.~ -~ -Alloy Smelter~ -This item acts as both a normal smelter (smelting 3 items at once) as well as an alloy smelter to make special alloys for -Ender IO.~ -~ -Painting Machine~ -This item can texture either fused quartz frames or conduit facade with an overlaying block's texture. Place the block with -the desired texture in the left hand slot and the frame/facade in the right hand slot. -~~~ -Energy and Conduits~ -~ -Generators~ -~ -Stirling Generator~ -Your basic generator, burning items such as coal to create power. 10 RF/t.~ -~ -Photovoltaic Cell~ -A solar panel. It produces 10 RF/t in sunlight.~ -~~~ -Power Storage/Information~ -~ -Power Monitor~ -This item allows you to monitor the power of all items connected to your Ender IO power grid and it's peripherals (ex: TE machines). -This block has two tabs. One displays information about the network while the other tab is for restone engine control.~ -~ -Capacitor Bank~ -This blcok acts as a scalable power storage option (it can become a multi-block). Each block added to the structure will -add it's power storage and at 2, 4, and 8 blocks the power output flow rate will increase. -~~~ -Conduits~ -~ -All the conduits can exist in the same block as another Ender IO conduit(s), allowing for some very compact setups. In -addition, they can be covered with a painted conduit facade to cover them up. Holding a conduit or a Yeta Wrench will -render the conduit facades invisible, allowing you to easily find your conduits.~ -~ -The liquid conduit transfers fluids. The rate of transfer is dependent on the fluid.~ -The redstone conduit transmits a redstine signal. A lever/button can be attached to it or a conduit switch can be used. -To active the conduit switch right clicj one of the small squares on the end of the conduit.~ -The energy conduits transfer energy at varying capacities.~ -The item conduits tranfer items; the empowered conduit has more filtering options.~ -~ -Both the item and liquid conduits have a GUI which can be accessed by right clicking the square that appears when the condit -connects to an inventory. This can be used to set insert/extraction modes. ALternatively a yeta wrench can be used to control -the output mode without entering the GUI. -~~~ -The Dimensional Transceiver~ -~ -This item acts as a tessaract, with the ability to transfer liquids, items, and power across dimensions through a single -block (to another transceiver on the same frequency). It has frequency settings in the GUI and will automatically output -energy/items to adjacent conduits/inventories. -~~~ -Tools~ -~ -Power Probe~ -This item will give information about a machine or even a network when right clicked on a machine. It is similar to a -portable power monitor.~ -~ -Yeta Wrench~ -This item acts as a wrench, meaning it can pick up machines (except IC2 machines) by shift right clicking the machine. -It also can see through facades, and only certain facades, the filter is indicated in the bottom left hand corner of the -screen and can be altered by shift right clicking while not aiming at a machine.~ -~~~ -Other~ -~ -Reservoir~ -This item, when built in a 2x2x1 square, will act as an infinite water source, much like in vanilla minecraft. The reservoir -can also auto-eject if right clicked with a wrench.~ -~ -Powered Light~ -This item will emit light but will require .1 Mj/t (or 1 Rf/t) to operate. It must be turned on with a redstone signal.~ -~ -Fused Quartz~ -This item acts as aesthetic glass with connected textures. The frame can also be painted by right clicking with a painted -fuzed quartz frame. - - ->EnderProspecting, Ender Prospecting< -Ender Prospecting adds a couple items to assist with manual mining. They are the Eye of Prospecting, the Talisman -of Prospecting, and the Totem of Prospecting.~ -~ -The Eye of prospecting can be crafted alongside any ore and will then be "tuned" to this ore. The next time you right -click the eye it will fly away from you, much liek an eye of ender, except it will fly toward the tuned ore. It will -then break, this item is one-time-use.~ -~ -The (Base) Talisman of Prospecting can be crafted with 5 tuned eyes to yield a tuned Talisman. It acts similarly to the -Eye, except it is reusable and has a smaller range. Every time the Talisman is right clicked it will indicate a direction -that the tuned or is.~ -~ -The Totem of Prospecting can be crafted/tuned similarly to the Talisman. It doesn't require being right clicked, but it -has an even smaller range and doesn't indicate a direction, only that the ore is in close proximity. - - ->EnderStorage, Ender Storage< -Ender Storage adds the Ender chest, the ender tank and the ender pouch. Each chest/pounch and tank will link to each other -assuming they are on the same "frequency" (indicated by the wool pads on top). The pads can be colored with each dye, -either in-game by clicking on the pads with a dye in hand, or by crafting the item below the dye frequency in a crafting -table.~ -~ -Ender pouches are merely a portable form of ender chests and can be linked to ender chests if they share the same frequency. -If you lose an ender item with item(s)/liquid(s) stored in it, they will remain stored in the chest with the frequency -they were stored in.~ -~ -If you place a diamond in the latch of an ender chest it will become linked to the player that placed the placed the -diamond, meaning that each player in a SMP server can have access to all 4096 frequencies. - - ->EngineersToolbox, Engineer's Toolbox< - - -**>ExtraBees, Extra Bees<** - ->ExtraCells, Extra Cells< - - -**>ExtraTrees, Extra Trees<** - ->ExtraUtilities, Extra Utilities< -Extra Utilities adds a bunch of useful blocks. It even adds it's own in game-documentation! Simply press use ("u") while -in NEI while hovering over an extra utilities block to see a description of the block. - ->Factorization, Factorization< - - ->FlatSigns, FlatSigns< -Flat signs alters existing signs in Minecraft by allowing flat versions of signs to be placed on the floor or the ceiling -by shift right clicking a sign on the floor/ceiling.~ -~ -It also allows for signs to be edited by using a sponge or the more durable sponge wipe. To craft a sponge just throw yellow -wool into water or on the ground while it is raining. - ->Forestry-Machines, Forestry-Machines< - - ->Forestry-Bees, Forestry-Bees< - - ->Forestry-Trees, Forestry-Trees< - - ->Gendustry, Gendustry< -Gendustry is a mod that acts as an add-on for Forestry's bee and tree (and butterfly) breeding systems. It adds a number -of blocks that will be discussed on the following page(s).~ -~ -Each block can accept EU, MJ, or RF. All blocks can input/output from any side. -~~~ -The Industrial Apiary~ -~ -This block requires 2 MJ/t to operate, has 4 slots for upgrades (but doesn't support frames), and also doesn't have the -90% production reduction of normal apiaries.~ -~ -The gague on the left is for power storage. The left slots are for a Queen/Princess and Drones, the middle 4 slots are for -upgrades, and the right 9 slots are for products and offspring.~ -~ -You can hover over the status icon (in the top right) to see more information about the block.~ -~ -Bees can be inserted and products can be extracted from any side. Upgrades cannot be automated, but the automation upgrade -will automatically move offspring back into the left slot to continue breeding~ -~ -The upgrades for gendustry are described by hovering over them in NEI. -~~~ -The Mutagen Producer~ -~ -This item will convert solid items into Mutagen (a liquid used to mutate bees/trees in the Mutatron).~ -~ -Items can be inserted into any side, and liquids will be automatically ejected to any adjacent pipe or tank.~ -~ -The items that are used as valid fuel sources are, in decreasing order of effectiveness, uranium, glowstone, and then -redstone. CLick on the recipes bar in the machine to see the detailed values for each item (power needed, mutagen produced). -~~~ -The Mutatron/Advanced Mutatron~ -~ -The Muatron consumes Mutagen to force mutations. It requires 1 bucket of mutagen (1000mb), 20,000 MJ per operation, and -a labware.~ -~ -The gauges on the left are for internal power and mutagen storage. For bees, princesses go in the top slot and -drones go in the bottom slot. For trees, saplings go in the top slot and pollen goes in the bottom slot. If a bee is -being mutated, the resulting bee will be a pure-bred bee. Ignoble bees have a 10% chance of not surviving the process.~ -~ -Bees and labware can be inserted from any side and results can be extracted from any side.~ -~ -The advanced mutatron allows a selection of mutation if there are multiple possible results. It can work twice as fast if -the energy supply is adequate. -~~~ -The Genetic Sampler/Imprinter~ -~ -Takes genetic samples from Bees, Trees, or even Butterflies, randomly selecting one genetic trait from the input and killing -the sampled creature in the process. It can also convert Extra-Bees serums into gendustry samples~ -~ -It consumes labware (top right) and blank samples (top left), as well as 20,000 MJ per operation.~ -~ -To use the samples, craft them with a template (shapeless receipe, any number of samples can be added at once). Every chromosome -(ex: fertility, species, etc.) can only be added once to a template, any additions will overwrite previous samples. All -samples must belong to the same species (ex: no using tree species on a bee). Unneeded templates/samples can be cleaned -by applying heat (ex: putting them in a furnace).~ -~ -The implanter replaces the traits of the input bee with the traits on the template (top left slot).~ -~ -It 80,000 MJ and a labware (top right slot) per operation. The template will not be consumed (or altered). Ignoble bees -have a 10% chance to not survive the process.~ -~ -The template can be removed form any side, but only when no imprinting is ongoing and the input slot is empty. -~~~ -The Industrial Grafter~ -~ -Acts as a powered Forestry grafter, that is very fast but also comsumes a lot of power.~ -~ -It can be charged in any machine that will charge MJ, RF, or tier 2 or higher EU (ex: capacitor bank, energetic infuser, -MFE). - - ->GregTech, GregTech< - -**GregTech is far, far too complex for Minecraft's Written Book format.** -**I think the only way to provide support for that mod is either a wiki link** -**Or a book format resembling Thaumcraft's or RotaryCraft's.** - ->GraviSuite, Gravitation Suite< -Gravitation Suite (Gravi Suite) is an addon for IC2 which adds very expenive, but powerful, EU-powered items. It adds both -tools and armor. -~~~ -Armor~ -~ -The Gravi-Chest Plate~ -~ -This item contains all of the functionality of the quantum chest plate as well as additional fucntions. It -provides creative mode flight and the ability to charge any EU items in your inventory. To toggle on/off flight, press 'f'. -To toggle on/off boost mode press 'ctrl'. This item also has 'hover mode'. This will allow you to fly much faster at an increased energy cost. The Gravi -Chest Plate can be charged in a MFSU or higher tier EU storage.~ -~ -Advanced Elextric Jetpack~ -~ -This item combines the electric jetpack and the advanced lappack. This item also has boost mode, hover mode, and, -obvioulsy, flight, as well as 1,000,00 EU energy storage.~ -~ -The Ultimate Solar Helmet~ -~ -This combines the ultimate hybrid solar panel from advanced solar panels with the quantum helmet to charge your armor at 512 EU/t -while still retaining the functionality of the quantum helmet.~ -~ -The Ultimate lappack~ -~ -This item holds 10,000,000 EU. -~~~ -Tools~ -~ -The tools can all be charged in a MFE or higher.~ -~ -The Vajra~ -~ -Thsi item can break any block (including bedrock) in one hit, even when flying or swimming, but it costs a very, very large -amount of EU per block broken~ -~ -Advanced Drill~ -Thsi drill is 35% faster than the diamond drill but it consumes significantly more power.~ -~ -Advanced Chainsaw~ -This chainsaw has a higher damage (12) than the normal chinsaw and it also operates 35% faster. - ->HardcoreEnderExpansion, Hardcore Ender Expansion< - - ->ImmibisMicroblocks, Immibis Microblocks< -Immibis Microblocks (along with Forge Multipart) creates the ability to cut down blocks into parts. This allows multiple -parts of blocks to exist in the same 1-block space, which wouldn't otherwise be possible. For example, torches are now -multiparts and so 2 of them can exist on the same intersection of a two walls. As another example, Thermal Expansion -pipes/conduits are multiparts, so a cover can be placed on them to "hide" the wiring while still retaining the -aesthetics of your house.~ -~ -To create multiparts simply craft a saw and then follow the NEI instructions to creaft your desired shape/size!~ -~ -Note: A large number of microblocks may cause lag. As long as you don't go beserk with them you should be fine though. - - -**>IndustrialCraft, IndustrialCraft (Experimental)<** -**Someone in the thread (Burn447) mentioned he was working on this** - ->Infinibows, Infinibows< -Infinibows is a small mod that just removes the need to have an arrow in your inventory to shoot a bow with the infinity -enchant. - ->LogisticsPipes, Logistics Pipes< - - ->MagicalCrops, Magical Crops< - - ->MagicBees, Magic Bees< -Magic bees is an addon for the Forestry bee-breeding system that also utilizes Thaumcraft. As a result, all of the information -for this mod can be found under the Magic Bees tab in the Thaumonomicon. If you are confused about bees in general, please -consult the "Forestry-Bees" book. - ->Mekanism, Mekanism< - - ->MFFS, Modular ForceField Systems< - - ->MFR, MineFactory Reloaded< -MineFactory Reloaded is a vast mod, comprising many useful -machines and automation devices. From conveyor belts to tree farms, -there is something in MFR for everybody.~ -~ -To get started, most of the MFR machines require rubber. Rubber trees are -generated throughout the landscape. Break the wood to acquire the flexible -material, then smelt it into rubber bars, and then again into raw plastic. -This plastic can then be crafted into sheets of plastic, which are the foundation -for most of the machines. -~ -Authors: Powercrystals, skyboy026 - ->ModularPowersuits, Modular Powersuits< - - ->Morph, Morph< -Morph is a mod that allows you to take on the characteristics (shape/size/ability(s)) of any creature you kill (except -bosses, although that is a config option).~ -~ -The flight ability is not able to be used until you reach the Nether, and do note that you will lose your morphs on death.~ -~ -To access your morphs, press "[" or "]", and then scroll down. Press "Enter" to select your morph.~ -~ -Morph also has a wheel for your favorite morphs, accessed by pressing "~"/"`". To add a morph to your favorites, press -the same key, "~", while selecting the desired morph in the menu. - ->MPSA, Modular Powersuits Addons< - - ->MystCraft-WritingAges, MystCraft-Writing< - - ->MystCraft-General, MystCraft-General<** - - ->Natura, Natura< -Natura adds world-generation, mainly in the form of some additional trees and some new blocks.~ -~ -The most notable are the berry bushes. These are found in the wild and will grow up and out and will produce berries -that can be harvested by right clicking on the bush. The berries don't fill your hunger very much, but they will -increase your saturation (a hidden value that determines when you will become hungry again), and you can even eat the -berries when full to max out your saturation.~ -~ -This mod also adds in generation to the Nether, allowing you to make bows that have a higher durability than vanilla ones.~ -~ -This mod also adds in cotton plants. These will grow until white balls appear on the plant, then can be harvested and will -revert to an earlier stage of growth rather than having to be replanted.~ -Finally, wheat/barley (wild form of wheat) can be crafted shapelessly into flour, which can then be smelted into bread. - ->NEI, Not Enough Items< -Not Enough Items (or NEI for short) adds the menu you see on your screen when opening your (or any) inventory. It is primarilly -used to show how to craft items and what items are used for. It can be disabled/hidden by pressing "o".~ -~ -To use NEI, hover over an item in the menu and press "r" for recipe to bring up how to make that item or press "u" for -use or what that item is used for. You will notice you also have a search bar on the bottom slot of your screen. This -can be used to limit the results shown on the right hand side tab. Double clicking the search bar will highlight results -that match whatever is typed into the search bar. Double clicking it agin will reset it.~ -~ -The left hand side of your screen contains saves, you can store your inventory in this save, and then loading it will -replace your inventory with the saved one (if cheat mode is enabled). In the top left you will see many options. Most -are self-explanatory, but the one you will likely use the most is next to the magnet; it will change your game mode.~ -~~~ -Options/NEI Modes~ -~ -At the bottom left you will see "options". Clicking on that will bring you to another menu screen. The most useful one -is the topmost one, "Inventory". There you can change between "recipe mode", "cheat mode", and "utility mode". Utility -mode will let you use the utilities in-game. Recipe mode will, when you left click an item on the main NEI panel, do the -same thing as pressing "r", while right clicking will do the same thing as pressing "u". Cheat mode will allow you to -obtain any number of items from the main NEI panel by clicking on them. Left clicking will give you 64 (a stack) of items, -while right clicking will give you one of the selected item. While in cheat mode you can drag items to the right hand -panel to delete them. -~~~ -Tips/Tricks~ -~ -Type in "@modnamehere" to see all the items from a specific mod.~ -You can right click the search bar to instantly clear it!! -In any crafting inventory, left clicking on the little '?' will overlay ghost images on the crafting grid to make it easy -to see what components go where. Shift left clicking will, if you have the items in your inventory, automatically put them -in the crafting grid in the correct location(s). - ->NetherOres, Nether Ores< -Nether ores adds ore generation to the Nether. These ores have a higher yield than their overworld counterparts, but -they also have a propesity to explode, so caution is necessary. - ->NotEnoughKeys, Not Enough Keys< -This mod adds a key-binding menu so it is more simple to navigat through the mess of conflicting keybinds. To access it -simply go into options -> controls and then modify as you see fit. - ->NuclearControl, Nuclear Control< - - ->ObsidiPlates, Obsidian Pressure Plates< -This mod adds a few pressure plates to the game.~ -~ -Obsidian Pressure Plates~ -Will only give off a redstone signal if a player is standing on them.~ -~ -Mossy Cobblestone Pressure Plates~ -Will only give off a signal if a NPC (ex: a villager) is standing on them.~ -~ -Both pressure plates can be silent (no clicking sound) and shrouded (see-through). It should be noted that to create a -silent and shrouded pressure plate you must apply silent first and then shrouded. - -**>OpenBlocks, OpenBlocks<** - ->OpenPeripheral, OpenPeripheral< -Open peripheral is an addon for ComputerCraft. It allows you to wrap a variety of items as peripherals.~ -~ -To see if an item is a valid peripheral (and to get the commands for it) do the following:~ -"side" is the side of the computer that the item to be wrapped as a peripheral is located (ex: "left", "top", etc). -The side should be enclosed in quotation marks.~ -p = peripheral.wrap("side")~ -print (p.listMethods())~ -~ -There are also some items that this mod adds, explained in the following page(s). -~~~ -PIM~ -This item allows you to access a player's inventory (if he/she) is standing on it.~ -~ -Sensor~ -This item allows you to scan the nearby area for information. Use listMethods() for more information.~ -~ -Peripheral Proxy~ -This item allows you to wrap certain items as peripherals through a modem. Make sure the arrows are facing the item to be -wrapped and the modem is on and is located on the back of the proxy.~ -~ -Ticket Machine~ -This item can be used to print out tickets for Railcraft.~ -~ -Terminal Glasses/Termianl Glasses Bridge~ -The glasses can be worn by a player and the information passed to the bridge will appear on the player's HUD.~ -~ -Duck Antenna~ -No idea :P - ->PluginsForForestry, Plugins for Forestry< -Plugins for forestry adds compatability between forestry and other mods. It adds the ability to use sugar and cactus in -a coke oven (railcraft) to make sugar/coal charcoal/coke for power. - ->PortalGun, Portal Gun< - - ->ProjectRed, Project Red< - - -**>QuarryPlus, Quarry Plus<** - ->Railcraft-Rails, Railcraft< - - ->Railcraft-Other, Railcraft-Other< - - ->RCDusts, RCDusts< -This mod adds metal dusts and recipes to the Railcraft rock crusher to -make it a fully capable ore processing machine, as well as adding several -tweaks for compatibility and some useful dust and railcraft-related configuration options. - ->RedstoneArsenal, Redstone Arsenal< -Redstone Arsenal adds tools and weaponry which harness the power of Redstone Flux, the -energy system added by Thermal Expansion. - ->Reliquary, Reliquary< - -**Outdated source but I don't think a lot has changed, it was merely ported to 1.6** - ->RemoteIO, RemoteIO< -Remote IO is a mod that allows you to link IO blocks to inventories, you are no longer limited to just 6 sides!~ -~ -For documentation on specific items simply craft the "Documentation Screen" and place any Remote IO item in the top -right hand slot to read a description on the block. - ->StevesCarts, Steve's Carts 2< - - ->StevesFactoryManager, Steve's Factory Manager< - - ->Thaumcraft, Thaumcraft 4< -Thaumcraft is a magical mod that requires you to "research" its items before you can craft them.~ -~ -There's all kinds of magical swag that you can build and play with, but it's probably best for you to -learn about it on your own.~ -~ -To get started, craft a iron capped wooden wand, -place a bookshelf on the ground, and right-click your wand on it.~ -~ -It should transform into a Thaumonomicon; the true guidebook for Thaumcraft!~ -~ -The only thing to know that is not documented in the book is that some research will be impossible, you can throw it -away and restart with newly generated research notes at any time though. - ->ThaumicTinkerer, Thaumic Tinkerer< -Thaumic Tinkerer is an addon to Thaumcraft (a magical mod). All the information is documented in the Thaumonomicon. - ->ThermalExpansion, Thermal Expansion 3< -Thermal Expansion (TE) is a "technology" mod that adds a power system called Redstone Flux (RF). -It has itemducts, fluiducts, and energy conduits for transporting items, liquids, and RF power -respectively, as well as a bunch of useful blocks for ore processing, automatic crafting, storage, and more.~ -~ -You can start generating RF power using the mod's dynamos and some energy conduits, with leadstone conduits being the -lowest tier. All TE conduits convert RF to MJ (Buildcraft energy) if needed. -You can rotate and pick up machines by right clicking and shift right clicking with a Crescent Hammer, -the mod's version of a wrench.~ -~~~ -All machines in the mod have their own configuration settings in their GUIs.~ -~ -The redstone behavior tab lets you choose how the machine will respond to redstone.~ -The configuration tab lets you choose where the machine will input and output its products, -be that energy, liquids, or power, on a per block face basis.~ -~ -Blue indicates an input on a given face, while orange indicates an output.~ -There are other colors used situationally depending on the machine. -For these, it's best to select that color in the configuration menu, then look -back at the main GUI of the machine.~ -The slot in the machine associated with that color will -be highlighted in that color. This should help indicate what that color's purpose is -for that particular machine. -~ - ->TinkersConstruct, Tinkers' Construct< -Tinkers' Construct is a mod that lets you build custom tools out of -various materials, each with their own special properties.~ -~ -To get started with the basics, check out the book "Materials And You" that -you should have spawned with. -~ - ->TinkersMechworks, Tinkers' Mechworks< -Tinker's Mechworks is an addon for Tinkers' Construct. It adds drawbridges, an igniter, and signal busses/terminals, all -of which are described on the following pages. -~~~ -Drawbridge~ -~ -The drawbridge can extend and retract 15 blocks in the direction it is facing. It is activated with a redstone signal. -The left slot is for a block that "disguises" the drawbridge to make it look like the block in the left slot. -The right slot is for the blocks that are to be extended/retracted.~ -~ -The extended drawbridge can extend up to 64 blocks.~ -~ -The advanced drawbridge can extend more than one type of block, as each block is placed in the GUI. -~~~ -Igniter~ -~ -The igniter will light the block in front of it on fire when given a redstoen signal and will extinguish the flame when -the resdtone signal is turned off. -~~~ -Signal Bus/Terminal/Wire~ -~ -These items function as redstone that can travel through blocks. To get started, craft a spool of wire by surrounding a -stone tool rod with 8 lengths of wire in a crafting table. The spool of wire can be crafted with additional lengths of wire -(up to 8 at a time maximum) to give the length of wire more length. The damage bar underneath the length of wire visually -represents how much wire is left.~ -~ -The spool of wire (truly the wire itself) is used to connect signal terminals to signal busses and back to signal terminals. -To connect the two right click on the top red part of the terminal with the spool of wire and then right click on the -signal bus with the same spool of wire. If you have enough wire and the terminal and the bus are 15 or less blocks away -you should see a small red line connecting the two. If you move your cursor away from the spool of wire on your hotbar the -red line will dissapear visually. Now you can connect the second terminal to the bus, using the length of wire, to -complete the circuit. -~~~ -Signal Bus/Terminal/Wire (continued)~ -~ -A redstone signal can be applied to the terminal (or the block the terminal is placed upon) and the redstone signal will -be transmitted to the terminal at the end of the wire. A terminal can connect to multiple busses but busses cannot connect -to other busses.~ -~ -Right clicking the white part of a signal terminal with an open hand will change the terminal's color. Only terminals of -the same color will send redstone signals. - ->TPPITweaks, TPPI Tweaks< -TPPITweaks is the mod made especially for the TPPI Modpack, -which is the representative modpack for /r/feedthebeast.~ -~ -It contains many tweaks for mods to better improve balance, -and some helpful objects to better guide -~~~ -the player in the modpack.~ -~ -Authors: wha-ha-ha, tterrag - ->Translocators, Translocators< -The Translocators mod adds 2 items to the game, the translocators themselves and a crafting grid.~ -~ -Translocators allow for the movement of items through a 1-block space. More info is on the following page.~ -~ -The crafting grid can be accessed by pressing 'c' (configurable in keybinds) and will bring up a grid to place items in. -Right click to place/remove items and press 'c' again on the grid to craft the item(s). -~~~ -Translocators can be placed on the side of an inventory/machine/tank. There are both item and liquid translocators.~ -~ -Right clicking on the protruding center of the translocator with an open hand will depress the center. Items/liquids will -always flow from the translocator with a protruding center to the translocator(s) with an inset center.~ -~ -Right clicking on the plate of the item translocator brings up a configurable filter. -~~~ -Adding a diamond nugget (a diamond in a crafting table gives 9) puts a translocator in regulate mode. -In this mode it will maintain a certain amount of items set in the filter in the inventory it’s attached to. -On an inserting face, it will only accept items to fill the inventory to the matching filter. -On an ejecting face, it will eject any items that don’t match the filter.~ -~ -Adding glowstone to the plate makes it transfer stacks at a time. -Adding redstone lets you toggle input/output with a redstone signal.~ -~ -Adding an iron ingot makes the translocator emit redstone signals to the attached inventory on certain conditions. -On an inserting face, it will emit if there is no room for any item that matches the filter. -On an ejecting face, it will emit if there is no place where any item can be put that matches the filter.~ -~ -Shift-Right clicking on the plate will strip and drop all upgrades placed on the translocator. -~~~ -Translocators will follow these rules:~ -~ -Items/liquids will always travel to non-redstone outputs if they can.~ -Items/Liquids will be evenly split between available outputs. Items will be taken from the slot with the largest quantity. - ->TwilightForest, Twilight Forest< - - ->Waila, Waila< -WAILA stands for "What Am I Looking At?" It introduces a HUD tooltip which indicates what block you are looking at. -It tells you the block name and what mod it is from.~ -~ -By adding the tooltip for the mod name in NEI you can now search "railcraft" instead of "@railcraft" to get the items -added by railcraft.~ -~ -It also adds some tooltip values for various items (ex: shows how much heat coal can produce in a firebox)~ -~ -There are also, by default, some (numpad) keybinds that can be used -as well:~ -1: Toggles on and off the HUD~ -2: Toggles on and off showinq liquids~ -3: Shows the uses for the item slected (through NEI)~ -4: SHows how the item selected can be used (through NEI)~ - ->Witchery, Witchery< -Witchery is a magical mod. It has it's own in-game documentation. To access it, type "Witchcraft" into NEI and then -obtain the books shown. The first one you will want to get is "Herbology" and then "Collectign Fumes." From there on it -is self-explanatory. -**** - ->WRCBE, Wireless Redstone - CBE< -At it's core Wireless Redstone ChickenBones Edition (WR-CBE) is a very simple mod; it allows you to wirelessly transmit -redstone signals. It even works across dimensions!~ -~ -For the items besides the wireless transmitter/receiver and the wireless remote I reccomend you check out ChickenBones' -Minecraft Forum page. He also describes SMP permissions commands on that post. However, The items stated above (the -only ones you will likely use) will be explained on the following page(s). -~~~ -Wireless Transmitter/Receiver~ -~ -Right click on the block to open the inventory. You can set a frequency for the redstone signal to transmit/receive from. -You can also access the advanced tab from here.~ -~ -In the advanced tab you will notice that you can add/remove names whick you can link to certain frequencies. This makes it -simple to remember what your different frequencies do and it is easy to switch back and forth between them.~ -~ -On the right you will notice a GUI that says Phase shift and some arrows. This allows you to color some frequencies with -vanilla dyes. Note: This is purely for easy identification, it does not affect the technical properties! -~~~ -Extra Info:~ -~ -The wireless remote is simply a portable wireless transmitter. It's gui can be opened by right-clicking.~ -~ -WR-CBE has ComputerCraft support. Wrap it as a peripheral and then use peripheral.getFreq(frequency) or -peripheral.setFreq(Frequency) - - ->ZansMinimap, Zan's Minimap< -Zan's Minimap (Voxel Map) provides the player with a convenient mini-map located in the top right hand corner of the -screen. It provides a variety of features.~ -~ -Adds an in-game waypoint system (that can show the location of your latest death).~ -~ -Adds a radar that can show a customizable number of mobs, animals, and players.~ -~ -The default key to access the menu is "M". There you can customize the look of your mini-map, configure the other keybinds -for the mod, change the radar/waypoints, and more. From 3c9b1d11c2ead6b3d64d2ad8014c8f1b83a025bd Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sat, 5 Apr 2014 04:35:29 -0400 Subject: [PATCH 15/35] Completely refactory tweaking system. - Now uses annotations, completely automated. --- src/main/java/tppitweaks/TPPITweaks.java | 20 +- .../tppitweaks/client/gui/MaricultureGui.java | 2 +- .../tppitweaks/event/TPPIEventHandler.java | 6 +- .../recipetweaks/RecipeAddition.java | 26 ++ .../recipetweaks/RecipeRemoval.java | 19 + .../tppitweaks/recipetweaks/RecipeTweaks.java | 372 +++++------------- .../recipetweaks/TweakingRegistry.java | 53 +++ .../recipetweaks/modTweaks/AM2Tweaks.java | 11 +- .../modTweaks/AdvancedGeneticsTweaks.java | 5 +- .../modTweaks/BigReactorsTweaks.java | 16 +- .../recipetweaks/modTweaks/DATweaks.java | 13 +- .../recipetweaks/modTweaks/DCTweaks.java | 5 +- .../recipetweaks/modTweaks/EnderIOTweaks.java | 10 +- .../modTweaks/EnderStorageTweaks.java | 11 +- .../recipetweaks/modTweaks/ExUTweaks.java | 70 ++-- .../modTweaks/GregtechTweaks.java | 8 +- .../recipetweaks/modTweaks/IC2Tweaks.java | 24 +- .../recipetweaks/modTweaks/JABBATweaks.java | 29 +- .../recipetweaks/modTweaks/MFRTweaks.java | 48 ++- .../recipetweaks/modTweaks/MPSATweaks.java | 118 +++--- .../modTweaks/MagicropsAndIC2Tweaks.java | 2 + .../modTweaks/MagicropsAndTETweaks.java | 2 + .../modTweaks/MagicropsTweaks.java | 25 +- .../modTweaks/MekanismTweaks.java | 13 +- .../modTweaks/OpenBlocksTweaks.java | 24 +- .../modTweaks/RailcraftTweaks.java | 3 + .../modTweaks/ReliquaryTweaks.java | 30 +- .../recipetweaks/modTweaks/SFMTweaks.java | 118 +++--- .../recipetweaks/modTweaks/TETweaks.java | 40 +- .../recipetweaks/modTweaks/TweakerBase.java | 21 - 30 files changed, 595 insertions(+), 549 deletions(-) create mode 100644 src/main/java/tppitweaks/recipetweaks/RecipeAddition.java create mode 100644 src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java create mode 100644 src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java delete mode 100644 src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index bed06ca..03a7868 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -18,6 +18,7 @@ import tppitweaks.proxy.CommonProxy; import tppitweaks.proxy.PacketHandler; import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.util.FileLoader; import tppitweaks.util.TPPIPlayerTracker; import cpw.mods.fml.common.FMLCommonHandler; @@ -83,9 +84,6 @@ public void preInit(FMLPreInitializationEvent event) @EventHandler public void init(FMLInitializationEvent event) { - if (ConfigurationHandler.unregisterFusedQuartz) - RecipeTweaks.fixFusedQuartz(); - // AM2SpawnControls.doAM2SpawnControls(); eventHandler = new TPPIEventHandler(); @@ -95,13 +93,13 @@ public void init(FMLInitializationEvent event) if (event.getSide().isClient()) proxy.initTickHandler(); + + tweakAtEvent(EventTime.INIT); } @EventHandler public void postInit(FMLPostInitializationEvent event) { - RecipeTweaks.doPostInitRecipeTweaks(); - if (FMLCommonHandler.instance().getSide().isClient()) { try @@ -113,6 +111,8 @@ public void postInit(FMLPostInitializationEvent event) e.printStackTrace(); } } + + tweakAtEvent(EventTime.POST_INIT); } @EventHandler @@ -120,4 +120,14 @@ public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new CommandTPPI()); } + + public static void tweakAtEvent(EventTime event) + { + if (event == EventTime.POST_INIT) + RecipeTweaks.removeRecipes(); + + RecipeTweaks.addRecipes(event); + + RecipeTweaks.doRemainingTweaks(event); + } } diff --git a/src/main/java/tppitweaks/client/gui/MaricultureGui.java b/src/main/java/tppitweaks/client/gui/MaricultureGui.java index 716d212..df84f84 100644 --- a/src/main/java/tppitweaks/client/gui/MaricultureGui.java +++ b/src/main/java/tppitweaks/client/gui/MaricultureGui.java @@ -55,7 +55,7 @@ protected void actionPerformed(GuiButton button) this.mc.displayGuiScreen(null); break; case 4: - ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false"); + ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false"); this.mc.displayGuiScreen(null); break; default: diff --git a/src/main/java/tppitweaks/event/TPPIEventHandler.java b/src/main/java/tppitweaks/event/TPPIEventHandler.java index ffff947..3792fb2 100644 --- a/src/main/java/tppitweaks/event/TPPIEventHandler.java +++ b/src/main/java/tppitweaks/event/TPPIEventHandler.java @@ -20,6 +20,7 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.lib.Reference; import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.modTweaks.DATweaks; import com.google.common.collect.ImmutableList; @@ -186,6 +187,9 @@ public void onItemTooltip(ItemTooltipEvent event) @ForgeSubscribe public void onPlayerJoin(EntityJoinWorldEvent event) { if (!RecipeTweaks.recipesInitialized) - RecipeTweaks.doPlayerJoinRecipeTweaks(); + { + TPPITweaks.tweakAtEvent(EventTime.PLAYER_JOIN); + RecipeTweaks.recipesInitialized = true; + } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java b/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java new file mode 100644 index 0000000..7d5b58e --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java @@ -0,0 +1,26 @@ +package tppitweaks.recipetweaks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a method as one that removes a recipe + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RecipeAddition +{ + public enum EventTime { INIT, POST_INIT, PLAYER_JOIN } + + /** + * The event at which this method is to be executed + */ + EventTime time() default EventTime.POST_INIT; + + /** + * The modids that must be loaded for this method to execute + */ + String[] requiredModids() default {}; +} diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java b/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java new file mode 100644 index 0000000..db30366 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java @@ -0,0 +1,19 @@ +package tppitweaks.recipetweaks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a method as one that removes recipes + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RecipeRemoval +{ + /** + * The modids that must be loaded for this method to execute + */ + String[] requiredModids() default {}; +} diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java index d51470a..458d696 100644 --- a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java @@ -1,295 +1,41 @@ package tppitweaks.recipetweaks; import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.ListIterator; +import java.util.Set; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.TPPITweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.modTweaks.*; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; + +import com.google.common.reflect.ClassPath; +import com.google.common.reflect.ClassPath.ClassInfo; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class RecipeTweaks { - public static boolean recipesInitialized; - private static boolean okayToTweakIC2; - private static boolean okayToTweakGT; - private static boolean okayToTweakEnderStorage; - private static boolean okayToTweakBigReactors; - private static boolean okayToTweakDA; - private static boolean okayToTweakSFM; - private static boolean okayToTweakOpenBlocks; - private static boolean okayToTweakAM2; - private static boolean okayToTweakMagicalCrops; - private static boolean okayToTweakDartCraft; - private static boolean okayToTweakExU; - private static boolean okayToTweakMPSA; - private static boolean okayToTweakMekanism; - private static boolean okayToTweakTE; - private static boolean okayToTweakReliquary; - private static boolean okayToTweakAdvancedGenetics; - private static boolean okayToTweakRailcraft; - private static boolean okayToTweakJABBA; - private static boolean okayToTweakMFR; - private static boolean okayToTweakEnderIO; - - public static void doPostInitRecipeTweaks() - { - recipesInitialized = false; - - checkWhatWeCanTweak(); - initRemovableRecipesMap(); - - if (okayToTweakGT) - GregtechTweaks.doStuff(); - - if (okayToTweakExU && ConfigurationHandler.fixExURecipes) - ExUTweaks.fixRecipes(); - - doOreDictTweaks(); - - if (okayToTweakIC2) { - IC2Tweaks.registerOres(); - IC2Tweaks.addRecipes(); - } - - if (okayToTweakMagicalCrops) - MagicropsTweaks.registerOres(); - - removeSomeRecipes(); - addRevisedRecipes(); - } - - public static void doPlayerJoinRecipeTweaks() - { - if (okayToTweakGT) - { - GregtechTweaks.addRecipes(); - } - if (okayToTweakExU) - { - ExUTweaks.reAddRecipeAfterLoad(); - } - if (okayToTweakRailcraft) - { - RailcraftTweaks.registerOres(); - } - if (okayToTweakIC2) - { - IC2Tweaks.doPostLoadRecipeAdditions(); - } - recipesInitialized = true; - } - - @SuppressWarnings({ "unchecked" }) - private static void removeSomeRecipes() - { - ListIterator iterator = CraftingManager.getInstance().getRecipeList().listIterator(); - while (iterator.hasNext()) - { - IRecipe r = iterator.next(); - if (canRemoveRecipe(r)) - { - iterator.remove(); - } - } - } - - private static void checkWhatWeCanTweak() - { - okayToTweakIC2 = Loader.isModLoaded("IC2"); - okayToTweakGT = Loader.isModLoaded("gregtech_addon"); - okayToTweakEnderStorage = Loader.isModLoaded("EnderStorage") && Loader.isModLoaded("ThermalExpansion"); - okayToTweakBigReactors = Loader.isModLoaded("BigReactors") && !OreDictionary.getOres("ingotSteel").isEmpty() - && (ConfigurationHandler.steelReactorCasings || ConfigurationHandler.glassFuelRods); - okayToTweakDA = Loader.isModLoaded("DimensionalAnchors") && ConfigurationHandler.tweakDA; - okayToTweakSFM = Loader.isModLoaded("AppliedEnergistics") && Loader.isModLoaded("StevesFactoryManager") && ConfigurationHandler.tweakSFM; - okayToTweakOpenBlocks = Loader.isModLoaded("OpenBlocks") && ConfigurationHandler.eloraamBreakersAndDeployers; - okayToTweakAM2 = Loader.isModLoaded("arsmagica2") && ConfigurationHandler.tweakAM2; - okayToTweakMagicalCrops = Loader.isModLoaded("magicalcrops"); - okayToTweakDartCraft = Loader.isModLoaded("DartCraft") && ConfigurationHandler.removeStupidEnergyCrystalRecipe; - okayToTweakExU = Loader.isModLoaded("ExtraUtilities"); - okayToTweakMPSA = Loader.isModLoaded("powersuitaddons") && ConfigurationHandler.changeMPSARecipes; - okayToTweakMekanism = Loader.isModLoaded("Mekanism"); - okayToTweakTE = Loader.isModLoaded("ThermalExpansion"); - okayToTweakReliquary = Loader.isModLoaded("xreliquary") && ConfigurationHandler.harderLillipadRecipe; - okayToTweakAdvancedGenetics = Loader.isModLoaded("advancedgenetics"); - okayToTweakRailcraft = Loader.isModLoaded("Railcraft"); - okayToTweakJABBA = ConfigurationHandler.tweakJABBA && Loader.isModLoaded("factorization") && Loader.isModLoaded("MineFactoryReloaded") && Loader.isModLoaded("JABBA"); - okayToTweakMFR = ConfigurationHandler.buffUnifierRecipe && Loader.isModLoaded("MineFactoryReloaded"); - okayToTweakEnderIO = Loader.isModLoaded("EnderIO"); - } - - private static void initRemovableRecipesMap() - { - /* - * Value -1 for key means no metadata sensitivity. Value = metadata for - * metadata sensitivity. - */ - - if (okayToTweakEnderStorage) - { - EnderStorageTweaks.init(); - } - if (okayToTweakBigReactors) - { - BigReactorsTweaks.init(); - } - if (okayToTweakDA) - { - DATweaks.init(); - } - if (okayToTweakSFM) - { - SFMTweaks.init(); - } - if (okayToTweakOpenBlocks) - { - OpenBlocksTweaks.init(); - } - if (Loader.isModLoaded("ExtraUtilities")) - { - ExUTweaks.init(); - } - if (okayToTweakAdvancedGenetics) - { - AdvancedGeneticsTweaks.init(); - } - if (okayToTweakDartCraft) - { - DCTweaks.init(); - } - if (okayToTweakIC2) - { - IC2Tweaks.init(); - } - if (okayToTweakMPSA) - { - MPSATweaks.init(); - } - if (okayToTweakMekanism) - { - MekanismTweaks.init(); - } - if (okayToTweakTE && ConfigurationHandler.harderActivatorRecipe) - { - TETweaks.init(); - } - if (okayToTweakMagicalCrops) - { - MagicropsTweaks.init(); - } - if (okayToTweakReliquary) - { - ReliquaryTweaks.init(); - } - if (okayToTweakJABBA) - { - JABBATweaks.init(); - } - if (okayToTweakMFR) - { - MFRTweaks.init(); - } - if (okayToTweakEnderIO) - { - EnderIOTweaks.init(); - } - } - - private static boolean canRemoveRecipe(IRecipe r) - { - try - { - ItemStack output = r.getRecipeOutput(); - HashSet validMetas = TweakerBase.getDamageValuesToRemove(output.itemID); - return validMetas.contains(-1) || validMetas.contains(output.getItemDamage()); - } - catch (Throwable e) - { - return false; - } - } - - private static void addRevisedRecipes() - { - if (okayToTweakEnderStorage) - EnderStorageTweaks.addRecipes(); - - if (okayToTweakBigReactors) - BigReactorsTweaks.addRecipes(); - - if (okayToTweakDA) - DATweaks.addRecipes(); - - if (okayToTweakSFM) - SFMTweaks.addRecipes(); - - if (okayToTweakOpenBlocks) - OpenBlocksTweaks.addRecipes(); - - if (okayToTweakAM2) - AM2Tweaks.addRecipes(); - - if (okayToTweakMPSA) - MPSATweaks.addRecipes(); - - if (okayToTweakMekanism && ConfigurationHandler.harderDisassemblerRecipe) - MekanismTweaks.addRecipes(); - - if (okayToTweakTE && ConfigurationHandler.harderActivatorRecipe) - TETweaks.addRecipes(); - - if (okayToTweakMagicalCrops) - MagicropsTweaks.addRecipes(); - - if (okayToTweakMagicalCrops && okayToTweakIC2) - MagicropsAndIC2Tweaks.addRecipes(); - - if (okayToTweakMagicalCrops && okayToTweakTE) - MagicropsAndTETweaks.addRecipes(); - - if (okayToTweakReliquary) - ReliquaryTweaks.addRecipes(); - - if (okayToTweakExU) - ExUTweaks.addRecipes(); - - if (okayToTweakJABBA) - JABBATweaks.addRecipes(); - - if (okayToTweakMFR) - MFRTweaks.addRecipes(); - - if (okayToTweakEnderIO) - EnderIOTweaks.addRecipes(); - - GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); - } - - /** - * Adds aluminIUM oreDict registries to aluminUM as well - */ + @SuppressWarnings("unchecked") private static void doOreDictTweaks() { + // cross registering alumin(um/ium) for (ItemStack s : OreDictionary.getOres("dustAluminium")) { OreDictionary.registerOre("dustAluminum", s); } + // fixing zinc smelting List dirtyZincs = OreDictionary.getOres("dustImpureZinc"); for (ItemStack stack : dirtyZincs) { @@ -297,11 +43,8 @@ private static void doOreDictTweaks() for (ItemStack stack1 : OreDictionary.getOres("ingotZinc")) FurnaceRecipes.smelting().addSmelting(newStack.itemID, newStack.getItemDamage(), stack1.copy(), 0.1F); } - } - - @SuppressWarnings("unchecked") - public static void fixFusedQuartz() - { + + // fixing fused quartz try { int id = OreDictionary.getOreID("glassHardened"); @@ -322,4 +65,93 @@ public static void fixFusedQuartz() t.printStackTrace(); } } + + private static void addMiscRecipes() + { + GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); + } + + public static void removeRecipes() + { + try + { + ClassPath classpath = ClassPath.from(RecipeTweaks.class.getClassLoader()); + Set classes = classpath.getTopLevelClasses("tppitweaks.recipetweaks.modTweaks"); + + for (ClassInfo c : classes) + { + Class clazz = c.load(); + for (Method m : clazz.getDeclaredMethods()) + { + RecipeRemoval r = m.getAnnotation(RecipeRemoval.class); + System.out.println(c.getName() + " : " + m.getName() + " : " + Arrays.deepToString(m.getDeclaredAnnotations())); + if (r != null && allModsLoaded(r.requiredModids())) + { + m.invoke(null, new Object[]{}); + } + } + } + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Could not perform recipe removals. This is a serious error!"); + t.printStackTrace(); + throw new RuntimeException("Recipe tweaks failed."); + } + + TweakingRegistry.removeRecipes(); + } + + public static void addRecipes(EventTime time) + { + try + { + ClassPath classpath = ClassPath.from(RecipeTweaks.class.getClassLoader()); + Set classes = classpath.getTopLevelClasses("tppitweaks.recipetweaks.modTweaks"); + + for (ClassInfo c : classes) + { + Class clazz = c.load(); + for (Method m : clazz.getDeclaredMethods()) + { + RecipeAddition r = m.getAnnotation(RecipeAddition.class); + if (r != null && allModsLoaded(r.requiredModids()) && r.time() == time) + { + m.invoke(null, new Object[]{}); + } + } + } + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Could not perform recipe additions. This is a serious error!"); + t.printStackTrace(); + throw new RuntimeException("Recipe tweaks failed."); + } + } + + public static void doRemainingTweaks(EventTime time) + { + switch(time) + { + case INIT: + addMiscRecipes(); + break; + case POST_INIT: + doOreDictTweaks(); + break; + default: + break; + } + } + + private static boolean allModsLoaded(String[] modids) + { + for (String s : modids) + { + if (!Loader.isModLoaded(s)) + return false; + } + return true; + } } diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java new file mode 100644 index 0000000..7d7d277 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -0,0 +1,53 @@ +package tppitweaks.recipetweaks; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.ListIterator; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + +public class TweakingRegistry +{ + private static HashMap> recipesToRemove = new HashMap>(); + + public static void markItemForRecipeRemoval(int id, int meta) { + if(!recipesToRemove.containsKey(id)) { + recipesToRemove.put(id, new HashSet()); + } + recipesToRemove.get(id).add(meta); + } + + public static HashSet getDamageValuesToRemove(int itemID) { + return recipesToRemove.get(itemID); + } + + @SuppressWarnings({ "unchecked" }) + static void removeRecipes() + { + ListIterator iterator = CraftingManager.getInstance().getRecipeList().listIterator(); + while (iterator.hasNext()) + { + IRecipe r = iterator.next(); + if (canRemoveRecipe(r)) + { + iterator.remove(); + } + } + } + + private static boolean canRemoveRecipe(IRecipe r) + { + try + { + ItemStack output = r.getRecipeOutput(); + HashSet validMetas = getDamageValuesToRemove(output.itemID); + return validMetas.contains(-1) || validMetas.contains(output.getItemDamage()); + } + catch (Throwable e) + { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java index 23b363c..ce03add 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java @@ -1,13 +1,20 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; public class AM2Tweaks { + @RecipeAddition(requiredModids="AM2") public static void addRecipes() { - GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), 'P', - new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); + if (ConfigurationHandler.tweakAM2) + { + GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), + 'P', new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java index 3f04979..dfc0676 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java @@ -1,12 +1,15 @@ package tppitweaks.recipetweaks.modTweaks; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; public class AdvancedGeneticsTweaks { + @RecipeRemoval(requiredModids="advancedgenetics") public static void init() { if(ConfigurationHandler.disableAGAutoOutputter) { - TweakerBase.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index f6dac01..b2a675d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -2,27 +2,33 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.registry.GameRegistry; public class BigReactorsTweaks { - + + @RecipeRemoval(requiredModids="BigReactors") public static void init() { - if (ConfigurationHandler.steelReactorCasings) + if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { - TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); } if (ConfigurationHandler.glassFuelRods) { - TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); } } + @RecipeAddition(requiredModids="BigReactors") public static void addRecipes() { - if (ConfigurationHandler.steelReactorCasings) + if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { ItemStack reactorPartStack = ((erogenousbeef.bigreactors.common.multiblock.block.BlockReactorPart) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).getReactorCasingItemStack(); reactorPartStack.stackSize = 4; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java index aacfc67..f95ffe6 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,15 +12,18 @@ public class DATweaks { + @RecipeRemoval(requiredModids="DimensionalAnchors") public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) mods.immibis.chunkloader.DimensionalAnchors.instance.block).blockID, -1); + if (ConfigurationHandler.tweakDA) + TweakingRegistry.markItemForRecipeRemoval(((Block) mods.immibis.chunkloader.DimensionalAnchors.instance.block).blockID, -1); } + @RecipeAddition(requiredModids="DimensionalAnchors") public static void addRecipes() { - GameRegistry.addRecipe(new ItemStack(mods.immibis.chunkloader.DimensionalAnchors.instance.block, 1, 0), "ded", "oIo", "gog", 'd', Item.diamond, 'e', Item.enderPearl, 'o', Block.obsidian, 'I', Block.blockIron, - 'g', Item.ingotGold); + if(ConfigurationHandler.tweakDA) + GameRegistry.addRecipe(new ItemStack(mods.immibis.chunkloader.DimensionalAnchors.instance.block, 1, 0), "ded", "oIo", "gog", 'd', Item.diamond, 'e', Item.enderPearl, 'o', Block.obsidian, 'I', Block.blockIron,'g', Item.ingotGold); } public static void addTooltip(ItemTooltipEvent event) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java index 4bd76cd..034400d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java @@ -2,13 +2,16 @@ import net.minecraft.item.Item; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import bluedart.item.DartItem; public class DCTweaks { + @RecipeRemoval(requiredModids="DartCraft") public static void init() { if (ConfigurationHandler.disableForceShears && DartItem.forceShears != null) - TweakerBase.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java index 79a458c..e75100b 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java @@ -4,21 +4,27 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import crazypants.enderio.Config; import crazypants.enderio.EnderIO; public class EnderIOTweaks { + @RecipeRemoval(requiredModids="EnderIO") public static void init() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) { - TweakerBase.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); - TweakerBase.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); } + } + @RecipeAddition(requiredModids="EnderIO") public static void addRecipes() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java index 3394f41..7f3fcc7 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java @@ -4,17 +4,22 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; -public class EnderStorageTweaks extends TweakerBase +public class EnderStorageTweaks extends TweakingRegistry { + @RecipeRemoval(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); if (ConfigurationHandler.enderPouchNerf) - TweakerBase.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); } + @RecipeAddition(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void addRecipes() { Object chestEnderElement = ConfigurationHandler.enderChestTesseract ? thermalexpansion.block.TEBlocks.blockTesseract : Item.enderPearl; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index 88135fe..663a195 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -12,52 +12,31 @@ import tppitweaks.block.ModBlocks; import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class ExUTweaks { + @RecipeRemoval(requiredModids="ExtraUtilities") public static void init() { if(ConfigurationHandler.nerfEnderQuarry) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); } if(ConfigurationHandler.nerfRedstoneGen) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); } if(ConfigurationHandler.nerfEnderGen && !OreDictionary.getOres("blockEnderium").isEmpty()) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); } } @SuppressWarnings("unchecked") - public static void fixRecipes() - { - try - { - TPPITweaks.logger.info("You made me do this, RwTema, know that ;_;"); - TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); - Field f = OreDictionary.class.getDeclaredField("oreIDs"); - f.setAccessible(true); - HashMap temp = (HashMap) f.get(null); - temp.remove("blockUnstable"); - temp.remove("burntquartz"); - temp.remove("icestone"); - f.set(null, temp); - } - catch (Throwable t) - { - t.printStackTrace(); - } - - OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); - OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); - OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); - - if (Loader.isModLoaded("gregtech_addon")) - TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); - } - + @RecipeAddition(requiredModids="ExtraUtilities") public static void addRecipes() { if(ConfigurationHandler.nerfEnderQuarry) { @@ -148,9 +127,36 @@ public static void addRecipes() { )); } + if (ConfigurationHandler.fixExURecipes) + { + try + { + TPPITweaks.logger.info("You made me do this, RwTema, know that ;_;"); + TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); + Field f = OreDictionary.class.getDeclaredField("oreIDs"); + f.setAccessible(true); + HashMap temp = (HashMap) f.get(null); + temp.remove("blockUnstable"); + temp.remove("burntquartz"); + temp.remove("icestone"); + f.set(null, temp); + } + catch (Throwable t) + { + t.printStackTrace(); + } + + OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); + OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); + OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); + + if (Loader.isModLoaded("gregtech_addon")) + TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); + } } - public static void reAddRecipeAfterLoad() + @RecipeAddition(requiredModids="ExtraUtilities", time=EventTime.PLAYER_JOIN) + public static void doPostLoadRecipeAdditions() { GameRegistry.addRecipe(new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5), "iii", "iii", "iii", 'i', extrautils.ExtraUtils.unstableIngot); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index dfd8d86..62c35eb 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -8,14 +8,17 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class GregtechTweaks { + @RecipeRemoval(requiredModids={"IC2", "gregtech_addon"}) public static void doStuff() { - if (ConfigurationHandler.addOsmiumToOreWasher && Loader.isModLoaded("IC2") && !OreDictionary.getOres("dustImpureOsmium").isEmpty() && !OreDictionary.getOres("dustOsmium").isEmpty()) { ic2.core.block.machine.tileentity.TileEntityOreWashing.addRecipe("dustImpureOsmium", 1, 1000, new ItemStack[] { OreDictionary.getOres("dustOsmium").get(0), ic2.core.Ic2Items.stoneDust }); @@ -70,7 +73,8 @@ public static void doStuff() } } - public static void addRecipes() { + @RecipeAddition(time=EventTime.PLAYER_JOIN, requiredModids={"IC2", "gregtech_addon"}) + public static void doPostLoadRecipeAdditions() { if(ConfigurationHandler.unnerfPaperRecipe) { GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}); TETweaks.addRecipes(); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java index 94515da..d769e84 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java @@ -8,25 +8,31 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class IC2Tweaks { + @RecipeRemoval(requiredModids="IC2") public static void init() { if (ConfigurationHandler.removeStupidEnergyCrystalRecipe) - TweakerBase.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.weedEx).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.suBattery).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.weedEx).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.suBattery).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); } + @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) public static void registerOres() { if (ConfigurationHandler.ic2TEGlassInterchangeability) @@ -46,6 +52,7 @@ public static void registerOres() } } + @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) public static void addRecipes() { if(ConfigurationHandler.doCharcoalBlockCompression) { if(!OreDictionary.getOres("blockCharcoal").isEmpty()) { @@ -54,6 +61,7 @@ public static void addRecipes() { } } + @RecipeAddition(requiredModids="IC2", time=EventTime.PLAYER_JOIN) public static void doPostLoadRecipeAdditions() { /* copypasta code, ignore horrible formatting */ diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java index 3fbe70d..284b928 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -5,27 +5,36 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.setup.Machine; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import factorization.shared.Core; public class JABBATweaks { + @RecipeRemoval(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); + if (ConfigurationHandler.tweakJABBA) + TweakingRegistry.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); } + @RecipeAddition(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) public static void addRecipes() { - // This only works for oak barrels - GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, - "wBw", - "wUw", - "www", + if (ConfigurationHandler.tweakJABBA) + { + GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, + "wBw", + "wUw", + "www", - 'w', "plankWood", - 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), - 'U', Machine.Unifier.getItemStack() - )); + 'w', "plankWood", + 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), + 'U', Machine.Unifier.getItemStack() + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index 93e8d42..f86479f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -5,34 +5,44 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.MineFactoryReloadedCore; import powercrystals.minefactoryreloaded.setup.Machine; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.registry.GameRegistry; public class MFRTweaks { + @RecipeRemoval(requiredModids="MineFactoryReloaded") public static void init() { - TweakerBase.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); + if (ConfigurationHandler.buffUnifierRecipe) + TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); } + @RecipeAddition(requiredModids="MineFactoryReloaded") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), - "RRR", - "SSS", - - 'R', "sheetPlastic", - 'S', "stone" - )); - - GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), - "RRR", - "rCr", - " M ", - - 'R', "sheetPlastic", - 'r', Item.redstone, - 'C', Item.comparator, - 'M', MineFactoryReloadedCore.machineBaseItem - )); + if (ConfigurationHandler.buffUnifierRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), + "RRR", + "SSS", + + 'R', "sheetPlastic", + 'S', "stone" + )); + + GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), + "RRR", + "rCr", + " M ", + + 'R', "sheetPlastic", + 'r', Item.redstone, + 'C', Item.comparator, + 'M', MineFactoryReloadedCore.machineBaseItem + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java index 3811731..99f1c90 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; @@ -8,84 +12,64 @@ public class MPSATweaks { private static ItemStack solarPanel, magnet, computerChip; + @RecipeRemoval(requiredModids="powersuitaddons") public static void init() { solarPanel = andrew.powersuits.common.AddonComponent.solarPanel; magnet = andrew.powersuits.common.AddonComponent.magnet; computerChip = andrew.powersuits.common.AddonComponent.computerChip; - - //removeRecipes(); - - TweakerBase.markItemForRecipeRemoval(solarPanel.itemID, 17); - TweakerBase.markItemForRecipeRemoval(magnet.itemID, 18); - TweakerBase.markItemForRecipeRemoval(computerChip.itemID, 19); - } - - /*@SuppressWarnings("unchecked") - private static void removeRecipes() - { - Iterator iter = CraftingManager.getInstance().getRecipeList().listIterator(); - - while (iter.hasNext()) + + if (ConfigurationHandler.changeMPSARecipes) { - IRecipe recipe = iter.next(); - if (recipe.getRecipeOutput() != null && recipe.getRecipeOutput().itemID == solarPanel.itemID && matchesDamage(recipe)) - { - iter.remove(); - } + TweakingRegistry.markItemForRecipeRemoval(solarPanel.itemID, 17); + TweakingRegistry.markItemForRecipeRemoval(magnet.itemID, 18); + TweakingRegistry.markItemForRecipeRemoval(computerChip.itemID, 19); } } - private static boolean matchesDamage(IRecipe recipe) + @RecipeAddition(requiredModids="powersuitaddons") + public static void addRecipes() { - int[] damages = {17,18,19}; - for (int i : damages) + if (ConfigurationHandler.changeMPSARecipes) { - if (i == recipe.getRecipeOutput().getItemDamage()) - return true; + ItemStack powerCoilGold = thermalexpansion.item.TEItems.powerCoilGold; + ItemStack powerCoilSilver = thermalexpansion.item.TEItems.powerCoilSilver; + ItemStack powerCoilElectrum = thermalexpansion.item.TEItems.powerCoilElectrum; + + GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, new Object[]{ + "GGG", + "PPP", + "WWW", + + 'G', "glassHardened", + 'P', "ingotPlatinum", + 'W', "componentWiring" + })); + + GameRegistry.addRecipe(new ShapedOreRecipe(magnet, new Object[]{ + "IRI", + "SSS", + "sRs", + + 'I', "ingotInvar", + 'R', powerCoilGold, + 'S', "componentSolenoid", + 's', "ingotSteel" + + })); + + GameRegistry.addRecipe(new ShapedOreRecipe(computerChip, new Object[]{ + "SC ", + "RIT", + "WWW", + + 'S', "componentSolenoid", + 'C', powerCoilElectrum, + 'R', powerCoilGold, + 'I', new ItemStack(buildcraft.BuildCraftSilicon.redstoneChipset, 1, 1), + 'T', powerCoilSilver, + 'W', "componentWiring" + })); } - return false; - }*/ - - public static void addRecipes() - { - ItemStack powerCoilGold = thermalexpansion.item.TEItems.powerCoilGold; - ItemStack powerCoilSilver = thermalexpansion.item.TEItems.powerCoilSilver; - ItemStack powerCoilElectrum = thermalexpansion.item.TEItems.powerCoilElectrum; - - GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, new Object[]{ - "GGG", - "PPP", - "WWW", - - 'G', "glassHardened", - 'P', "ingotPlatinum", - 'W', "componentWiring" - })); - - GameRegistry.addRecipe(new ShapedOreRecipe(magnet, new Object[]{ - "IRI", - "SSS", - "sRs", - - 'I', "ingotInvar", - 'R', powerCoilGold, - 'S', "componentSolenoid", - 's', "ingotSteel" - - })); - - GameRegistry.addRecipe(new ShapedOreRecipe(computerChip, new Object[]{ - "SC ", - "RIT", - "WWW", - - 'S', "componentSolenoid", - 'C', powerCoilElectrum, - 'R', powerCoilGold, - 'I', new ItemStack(buildcraft.BuildCraftSilicon.redstoneChipset, 1, 1), - 'T', powerCoilSilver, - 'W', "componentWiring" - })); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java index 9a3e4cf..37af86d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java @@ -1,9 +1,11 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; public class MagicropsAndIC2Tweaks { + @RecipeAddition(requiredModids={"magicalcrops", "IC2"}) public static void addRecipes() { ic2.core.block.machine.tileentity.TileEntityMacerator.addRecipe("oreMCropsEssence", 1, new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0)); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java index 757df33..7fa8e0f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java @@ -1,10 +1,12 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class MagicropsAndTETweaks { + @RecipeAddition(requiredModids={"magicalcrops", "ThermalExpansion"}) public static void addRecipes() { thermalexpansion.util.crafting.PulverizerManager.addRecipe(2400, OreDictionary.getOres("oreMCropsEssence").get(0), new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0), new ItemStack(magicalcrops.mod_mCrops.CropEssence, 1, 0), 5); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java index 915bb23..1cc7d75 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java @@ -5,23 +5,29 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class MagicropsTweaks { + @RecipeRemoval(requiredModids="magicalcrops") public static void init() { - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEssence.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsDiamond.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEmerald.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsXP.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsThaumcraftShard.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsCobalt.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsArdite.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsPlatinum.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsUranium.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEssence.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsDiamond.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEmerald.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsXP.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsThaumcraftShard.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsCobalt.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsArdite.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsPlatinum.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsUranium.itemID, -1); } + @RecipeAddition(requiredModids="magicalcrops", time=EventTime.INIT) public static void registerOres() { if (ConfigurationHandler.registerMagicalCropsOre) @@ -31,6 +37,7 @@ public static void registerOres() } } + @RecipeAddition(requiredModids="magicalcrops") public static void addRecipes() { if (ConfigurationHandler.addEssenceSeedRecipe) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index 9f44ee4..98d6aa6 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -8,27 +8,32 @@ import net.minecraftforge.oredict.OreDictionary; import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class MekanismTweaks { + @RecipeRemoval(requiredModids="Mekanism") public static void init() { if (ConfigurationHandler.harderDisassemblerRecipe) { - TweakerBase.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); } if (ConfigurationHandler.disableCardboardBox) { - TweakerBase.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); } if (ConfigurationHandler.disableMiner || ConfigurationHandler.nerfMiner) { - TweakerBase.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); } } + @RecipeAddition(requiredModids="Mekanism") public static void addRecipes() { if (ConfigurationHandler.harderDisassemblerRecipe) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java index a4e4993..5f7ee97 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,17 +12,25 @@ public class OpenBlocksTweaks { + @RecipeRemoval(requiredModids="OpenBlocks") public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + if (ConfigurationHandler.eloraamBreakersAndDeployers) + { + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + } } + @RecipeAddition(requiredModids="OpenBlocks") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, 'P', - Block.pistonBase, 'R', Item.redstone })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', - Block.pistonBase, 'R', Item.redstone })); + if (ConfigurationHandler.eloraamBreakersAndDeployers) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, + 'P', Block.pistonBase, 'R', Item.redstone })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', + Block.pistonBase, 'R', Item.redstone })); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java index a484aae..afc8095 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java @@ -1,5 +1,7 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import mods.railcraft.common.items.ItemPlate; import mods.railcraft.common.items.ItemPlate.EnumPlate; import net.minecraft.item.ItemStack; @@ -8,6 +10,7 @@ public class RailcraftTweaks { + @RecipeAddition(requiredModids={"Railcraft"}, time=EventTime.PLAYER_JOIN) public static void registerOres() { // Please don't kill me CJ diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java index 7d2726f..f8c073e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -7,21 +11,27 @@ public class ReliquaryTweaks { + @RecipeRemoval(requiredModids="xreliquary") public static void init() { - TweakerBase.markItemForRecipeRemoval(xreliquary.items.XRItems.condensedPotion.itemID, 10); + if (ConfigurationHandler.harderLillipadRecipe) + TweakingRegistry.markItemForRecipeRemoval(xreliquary.items.XRItems.condensedPotion.itemID, 10); } + @RecipeAddition(requiredModids="xreliquary") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(xreliquary.items.XRItems.condensedPotion, 1, 10), new Object[]{ - "sap", - "aap", - "ppp", - - 's', xreliquary.items.XRItems.condensedPotion, - 'a', Item.appleGold, - 'p', new ItemStack(Item.dyePowder, 1, 15) - })); + if (ConfigurationHandler.harderLillipadRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(xreliquary.items.XRItems.condensedPotion, 1, 10), + "sap", + "aap", + "ppp", + + 's', xreliquary.items.XRItems.condensedPotion, + 'a', Item.appleGold, + 'p', new ItemStack(Item.dyePowder, 1, 15) + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java index c4167fc..07b0a25 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java @@ -4,73 +4,83 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapelessOreRecipe; +import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class SFMTweaks { + @RecipeRemoval(requiredModids={"AppliedEnergistics", "StevesFactoryManager"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); - - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + if (ConfigurationHandler.tweakSFM) + { + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + } } - + + @RecipeAddition(requiredModids={"AppliedEnergistics", "StevesFactoryManager"}) public static void addRecipes() { - GameRegistry.addRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockManager), new Object[] { "III", "IRI", "SPS", Character.valueOf('R'), new ItemStack(ModItems.tppiMaterial), + if (ConfigurationHandler.tweakSFM) + { + GameRegistry.addRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockManager), new Object[] { "III", "IRI", "SPS", Character.valueOf('R'), new ItemStack(ModItems.tppiMaterial), Character.valueOf('P'), appeng.api.Materials.matConversionMatrix.copy(), Character.valueOf('I'), Item.ingotIron, Character.valueOf('S'), Block.stone }); - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCable, 8), - new Object[] { "GPG", "IRI", "GPG", Character.valueOf('R'), appeng.api.Materials.matFluxDust.copy(), Character.valueOf('G'), Block.glass, Character.valueOf('I'), Item.ingotIron, + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCable, 8), + new Object[] { "GPG", "IRI", "GPG", Character.valueOf('R'), appeng.api.Materials.matFluxDust.copy(), Character.valueOf('G'), Block.glass, Character.valueOf('I'), Item.ingotIron, Character.valueOf('P'), Block.pressurePlateIron }); - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableRelay, 1, 8), - new Object[]{ - "fBf", - "BIB", - "fBf", - - 'B', Block.blockLapis, - 'I', vswe.stevesfactory.blocks.Blocks.blockCableRelay, - 'f', appeng.api.Materials.matFluxDust.copy() - }); - - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableInput), - new Object[]{ - " r ", - "rIr", - " r ", - - 'r', Item.redstone, - 'I', vswe.stevesfactory.blocks.Blocks.blockCable - }); - - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableOutput), - new Object[]{ - "rtr", - "rIr", - "rrr", - - 'r', Item.redstone, - 't', appeng.api.Blocks.blkLevelEmitter.copy(), - 'I', vswe.stevesfactory.blocks.Blocks.blockCable - }); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), vswe.stevesfactory.blocks.Blocks.blockCable, Block.hopperBlock, Block.dropper, appeng.api.Blocks.blkInterface.copy())); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 8), new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), appeng.api.Materials.matProcessorBasic.copy())); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableBreaker), vswe.stevesfactory.blocks.Blocks.blockCable, Item.pickaxeIron, Block.dispenser, appeng.api.Blocks.blkInterface.copy())); - + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableRelay, 1, 8), + new Object[]{ + "fBf", + "BIB", + "fBf", + + 'B', Block.blockLapis, + 'I', vswe.stevesfactory.blocks.Blocks.blockCableRelay, + 'f', appeng.api.Materials.matFluxDust.copy() + }); + + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableInput), + new Object[]{ + " r ", + "rIr", + " r ", + + 'r', Item.redstone, + 'I', vswe.stevesfactory.blocks.Blocks.blockCable + }); + + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableOutput), + new Object[]{ + "rtr", + "rIr", + "rrr", + + 'r', Item.redstone, + 't', appeng.api.Blocks.blkLevelEmitter.copy(), + 'I', vswe.stevesfactory.blocks.Blocks.blockCable + }); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), vswe.stevesfactory.blocks.Blocks.blockCable, Block.hopperBlock, Block.dropper, appeng.api.Blocks.blkInterface.copy())); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 8), new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), appeng.api.Materials.matProcessorBasic.copy())); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableBreaker), vswe.stevesfactory.blocks.Blocks.blockCable, Item.pickaxeIron, Block.dispenser, appeng.api.Blocks.blkInterface.copy())); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java index 6b2c64c..c60e52c 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java @@ -1,5 +1,10 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.TPPITweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -9,27 +14,36 @@ public class TETweaks { + @RecipeRemoval(requiredModids="ThermalExpansion") public static void init() { - TweakerBase.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); + if (ConfigurationHandler.harderActivatorRecipe) + TweakingRegistry.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); } + @RecipeAddition(requiredModids="ThermalExpansion") public static void addRecipes() { try { GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips}); - }catch(Throwable t) {} + }catch(Throwable t){ + TPPITweaks.logger.severe("Could not add paper recipe to pulverizer!"); + t.printStackTrace(); + } - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(thermalexpansion.block.TEBlocks.blockDevice.blockID, 1, 2), new Object[]{ - "scs", - "tpt", - "sns", - - 's', "ingotSteel", - 'p', Block.pistonBase, - 't', "ingotTin", - 'c', Block.chest, - 'n', thermalexpansion.item.TEItems.pneumaticServo - })); + if (ConfigurationHandler.harderActivatorRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(thermalexpansion.block.TEBlocks.blockDevice.blockID, 1, 2), new Object[]{ + "scs", + "tpt", + "sns", + + 's', OreDictionary.getOres("ingotSteel").isEmpty() ? "ingotIron" : "ingotSteel", + 'p', Block.pistonBase, + 't', "ingotTin", + 'c', Block.chest, + 'n', thermalexpansion.item.TEItems.pneumaticServo + })); + } if (OreDictionary.getOres("dustRuby").size() != 0) thermalexpansion.util.crafting.PulverizerManager.addIngotNameToDustRecipe(2400, "gemRuby", OreDictionary.getOres("dustRuby").get(0)); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java deleted file mode 100644 index b870b51..0000000 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java +++ /dev/null @@ -1,21 +0,0 @@ -package tppitweaks.recipetweaks.modTweaks; - -import java.util.HashMap; -import java.util.HashSet; - -public class TweakerBase -{ - private static HashMap> recipesToRemove = new HashMap>(); - - public static void markItemForRecipeRemoval(int id, int meta) { - if(!recipesToRemove.containsKey(id)) { - recipesToRemove.put(id, new HashSet()); - } - recipesToRemove.get(id).add(meta); - } - - public static HashSet getDamageValuesToRemove(int itemID) { - return recipesToRemove.get(itemID); - } - -} \ No newline at end of file From b97bfa6f71dfe0f3c351d1f4165c518b3266cf26 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sat, 5 Apr 2014 04:35:29 -0400 Subject: [PATCH 16/35] Completely refactor tweaking system. - Now uses annotations, completely automated. --- src/main/java/tppitweaks/TPPITweaks.java | 20 +- .../tppitweaks/client/gui/MaricultureGui.java | 2 +- .../tppitweaks/event/TPPIEventHandler.java | 6 +- .../recipetweaks/RecipeAddition.java | 26 ++ .../recipetweaks/RecipeRemoval.java | 19 + .../tppitweaks/recipetweaks/RecipeTweaks.java | 372 +++++------------- .../recipetweaks/TweakingRegistry.java | 53 +++ .../recipetweaks/modTweaks/AM2Tweaks.java | 11 +- .../modTweaks/AdvancedGeneticsTweaks.java | 5 +- .../modTweaks/BigReactorsTweaks.java | 16 +- .../recipetweaks/modTweaks/DATweaks.java | 13 +- .../recipetweaks/modTweaks/DCTweaks.java | 5 +- .../recipetweaks/modTweaks/EnderIOTweaks.java | 10 +- .../modTweaks/EnderStorageTweaks.java | 11 +- .../recipetweaks/modTweaks/ExUTweaks.java | 70 ++-- .../modTweaks/GregtechTweaks.java | 8 +- .../recipetweaks/modTweaks/IC2Tweaks.java | 24 +- .../recipetweaks/modTweaks/JABBATweaks.java | 29 +- .../recipetweaks/modTweaks/MFRTweaks.java | 48 ++- .../recipetweaks/modTweaks/MPSATweaks.java | 118 +++--- .../modTweaks/MagicropsAndIC2Tweaks.java | 2 + .../modTweaks/MagicropsAndTETweaks.java | 2 + .../modTweaks/MagicropsTweaks.java | 25 +- .../modTweaks/MekanismTweaks.java | 13 +- .../modTweaks/OpenBlocksTweaks.java | 24 +- .../modTweaks/RailcraftTweaks.java | 3 + .../modTweaks/ReliquaryTweaks.java | 30 +- .../recipetweaks/modTweaks/SFMTweaks.java | 118 +++--- .../recipetweaks/modTweaks/TETweaks.java | 40 +- .../recipetweaks/modTweaks/TweakerBase.java | 21 - 30 files changed, 595 insertions(+), 549 deletions(-) create mode 100644 src/main/java/tppitweaks/recipetweaks/RecipeAddition.java create mode 100644 src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java create mode 100644 src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java delete mode 100644 src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index bed06ca..03a7868 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -18,6 +18,7 @@ import tppitweaks.proxy.CommonProxy; import tppitweaks.proxy.PacketHandler; import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.util.FileLoader; import tppitweaks.util.TPPIPlayerTracker; import cpw.mods.fml.common.FMLCommonHandler; @@ -83,9 +84,6 @@ public void preInit(FMLPreInitializationEvent event) @EventHandler public void init(FMLInitializationEvent event) { - if (ConfigurationHandler.unregisterFusedQuartz) - RecipeTweaks.fixFusedQuartz(); - // AM2SpawnControls.doAM2SpawnControls(); eventHandler = new TPPIEventHandler(); @@ -95,13 +93,13 @@ public void init(FMLInitializationEvent event) if (event.getSide().isClient()) proxy.initTickHandler(); + + tweakAtEvent(EventTime.INIT); } @EventHandler public void postInit(FMLPostInitializationEvent event) { - RecipeTweaks.doPostInitRecipeTweaks(); - if (FMLCommonHandler.instance().getSide().isClient()) { try @@ -113,6 +111,8 @@ public void postInit(FMLPostInitializationEvent event) e.printStackTrace(); } } + + tweakAtEvent(EventTime.POST_INIT); } @EventHandler @@ -120,4 +120,14 @@ public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new CommandTPPI()); } + + public static void tweakAtEvent(EventTime event) + { + if (event == EventTime.POST_INIT) + RecipeTweaks.removeRecipes(); + + RecipeTweaks.addRecipes(event); + + RecipeTweaks.doRemainingTweaks(event); + } } diff --git a/src/main/java/tppitweaks/client/gui/MaricultureGui.java b/src/main/java/tppitweaks/client/gui/MaricultureGui.java index 716d212..df84f84 100644 --- a/src/main/java/tppitweaks/client/gui/MaricultureGui.java +++ b/src/main/java/tppitweaks/client/gui/MaricultureGui.java @@ -55,7 +55,7 @@ protected void actionPerformed(GuiButton button) this.mc.displayGuiScreen(null); break; case 4: - ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false"); + ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false"); this.mc.displayGuiScreen(null); break; default: diff --git a/src/main/java/tppitweaks/event/TPPIEventHandler.java b/src/main/java/tppitweaks/event/TPPIEventHandler.java index ffff947..3792fb2 100644 --- a/src/main/java/tppitweaks/event/TPPIEventHandler.java +++ b/src/main/java/tppitweaks/event/TPPIEventHandler.java @@ -20,6 +20,7 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.lib.Reference; import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.modTweaks.DATweaks; import com.google.common.collect.ImmutableList; @@ -186,6 +187,9 @@ public void onItemTooltip(ItemTooltipEvent event) @ForgeSubscribe public void onPlayerJoin(EntityJoinWorldEvent event) { if (!RecipeTweaks.recipesInitialized) - RecipeTweaks.doPlayerJoinRecipeTweaks(); + { + TPPITweaks.tweakAtEvent(EventTime.PLAYER_JOIN); + RecipeTweaks.recipesInitialized = true; + } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java b/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java new file mode 100644 index 0000000..7d5b58e --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java @@ -0,0 +1,26 @@ +package tppitweaks.recipetweaks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a method as one that removes a recipe + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RecipeAddition +{ + public enum EventTime { INIT, POST_INIT, PLAYER_JOIN } + + /** + * The event at which this method is to be executed + */ + EventTime time() default EventTime.POST_INIT; + + /** + * The modids that must be loaded for this method to execute + */ + String[] requiredModids() default {}; +} diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java b/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java new file mode 100644 index 0000000..db30366 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java @@ -0,0 +1,19 @@ +package tppitweaks.recipetweaks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a method as one that removes recipes + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RecipeRemoval +{ + /** + * The modids that must be loaded for this method to execute + */ + String[] requiredModids() default {}; +} diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java index d51470a..458d696 100644 --- a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java @@ -1,295 +1,41 @@ package tppitweaks.recipetweaks; import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.ListIterator; +import java.util.Set; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.TPPITweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.modTweaks.*; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; + +import com.google.common.reflect.ClassPath; +import com.google.common.reflect.ClassPath.ClassInfo; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class RecipeTweaks { - public static boolean recipesInitialized; - private static boolean okayToTweakIC2; - private static boolean okayToTweakGT; - private static boolean okayToTweakEnderStorage; - private static boolean okayToTweakBigReactors; - private static boolean okayToTweakDA; - private static boolean okayToTweakSFM; - private static boolean okayToTweakOpenBlocks; - private static boolean okayToTweakAM2; - private static boolean okayToTweakMagicalCrops; - private static boolean okayToTweakDartCraft; - private static boolean okayToTweakExU; - private static boolean okayToTweakMPSA; - private static boolean okayToTweakMekanism; - private static boolean okayToTweakTE; - private static boolean okayToTweakReliquary; - private static boolean okayToTweakAdvancedGenetics; - private static boolean okayToTweakRailcraft; - private static boolean okayToTweakJABBA; - private static boolean okayToTweakMFR; - private static boolean okayToTweakEnderIO; - - public static void doPostInitRecipeTweaks() - { - recipesInitialized = false; - - checkWhatWeCanTweak(); - initRemovableRecipesMap(); - - if (okayToTweakGT) - GregtechTweaks.doStuff(); - - if (okayToTweakExU && ConfigurationHandler.fixExURecipes) - ExUTweaks.fixRecipes(); - - doOreDictTweaks(); - - if (okayToTweakIC2) { - IC2Tweaks.registerOres(); - IC2Tweaks.addRecipes(); - } - - if (okayToTweakMagicalCrops) - MagicropsTweaks.registerOres(); - - removeSomeRecipes(); - addRevisedRecipes(); - } - - public static void doPlayerJoinRecipeTweaks() - { - if (okayToTweakGT) - { - GregtechTweaks.addRecipes(); - } - if (okayToTweakExU) - { - ExUTweaks.reAddRecipeAfterLoad(); - } - if (okayToTweakRailcraft) - { - RailcraftTweaks.registerOres(); - } - if (okayToTweakIC2) - { - IC2Tweaks.doPostLoadRecipeAdditions(); - } - recipesInitialized = true; - } - - @SuppressWarnings({ "unchecked" }) - private static void removeSomeRecipes() - { - ListIterator iterator = CraftingManager.getInstance().getRecipeList().listIterator(); - while (iterator.hasNext()) - { - IRecipe r = iterator.next(); - if (canRemoveRecipe(r)) - { - iterator.remove(); - } - } - } - - private static void checkWhatWeCanTweak() - { - okayToTweakIC2 = Loader.isModLoaded("IC2"); - okayToTweakGT = Loader.isModLoaded("gregtech_addon"); - okayToTweakEnderStorage = Loader.isModLoaded("EnderStorage") && Loader.isModLoaded("ThermalExpansion"); - okayToTweakBigReactors = Loader.isModLoaded("BigReactors") && !OreDictionary.getOres("ingotSteel").isEmpty() - && (ConfigurationHandler.steelReactorCasings || ConfigurationHandler.glassFuelRods); - okayToTweakDA = Loader.isModLoaded("DimensionalAnchors") && ConfigurationHandler.tweakDA; - okayToTweakSFM = Loader.isModLoaded("AppliedEnergistics") && Loader.isModLoaded("StevesFactoryManager") && ConfigurationHandler.tweakSFM; - okayToTweakOpenBlocks = Loader.isModLoaded("OpenBlocks") && ConfigurationHandler.eloraamBreakersAndDeployers; - okayToTweakAM2 = Loader.isModLoaded("arsmagica2") && ConfigurationHandler.tweakAM2; - okayToTweakMagicalCrops = Loader.isModLoaded("magicalcrops"); - okayToTweakDartCraft = Loader.isModLoaded("DartCraft") && ConfigurationHandler.removeStupidEnergyCrystalRecipe; - okayToTweakExU = Loader.isModLoaded("ExtraUtilities"); - okayToTweakMPSA = Loader.isModLoaded("powersuitaddons") && ConfigurationHandler.changeMPSARecipes; - okayToTweakMekanism = Loader.isModLoaded("Mekanism"); - okayToTweakTE = Loader.isModLoaded("ThermalExpansion"); - okayToTweakReliquary = Loader.isModLoaded("xreliquary") && ConfigurationHandler.harderLillipadRecipe; - okayToTweakAdvancedGenetics = Loader.isModLoaded("advancedgenetics"); - okayToTweakRailcraft = Loader.isModLoaded("Railcraft"); - okayToTweakJABBA = ConfigurationHandler.tweakJABBA && Loader.isModLoaded("factorization") && Loader.isModLoaded("MineFactoryReloaded") && Loader.isModLoaded("JABBA"); - okayToTweakMFR = ConfigurationHandler.buffUnifierRecipe && Loader.isModLoaded("MineFactoryReloaded"); - okayToTweakEnderIO = Loader.isModLoaded("EnderIO"); - } - - private static void initRemovableRecipesMap() - { - /* - * Value -1 for key means no metadata sensitivity. Value = metadata for - * metadata sensitivity. - */ - - if (okayToTweakEnderStorage) - { - EnderStorageTweaks.init(); - } - if (okayToTweakBigReactors) - { - BigReactorsTweaks.init(); - } - if (okayToTweakDA) - { - DATweaks.init(); - } - if (okayToTweakSFM) - { - SFMTweaks.init(); - } - if (okayToTweakOpenBlocks) - { - OpenBlocksTweaks.init(); - } - if (Loader.isModLoaded("ExtraUtilities")) - { - ExUTweaks.init(); - } - if (okayToTweakAdvancedGenetics) - { - AdvancedGeneticsTweaks.init(); - } - if (okayToTweakDartCraft) - { - DCTweaks.init(); - } - if (okayToTweakIC2) - { - IC2Tweaks.init(); - } - if (okayToTweakMPSA) - { - MPSATweaks.init(); - } - if (okayToTweakMekanism) - { - MekanismTweaks.init(); - } - if (okayToTweakTE && ConfigurationHandler.harderActivatorRecipe) - { - TETweaks.init(); - } - if (okayToTweakMagicalCrops) - { - MagicropsTweaks.init(); - } - if (okayToTweakReliquary) - { - ReliquaryTweaks.init(); - } - if (okayToTweakJABBA) - { - JABBATweaks.init(); - } - if (okayToTweakMFR) - { - MFRTweaks.init(); - } - if (okayToTweakEnderIO) - { - EnderIOTweaks.init(); - } - } - - private static boolean canRemoveRecipe(IRecipe r) - { - try - { - ItemStack output = r.getRecipeOutput(); - HashSet validMetas = TweakerBase.getDamageValuesToRemove(output.itemID); - return validMetas.contains(-1) || validMetas.contains(output.getItemDamage()); - } - catch (Throwable e) - { - return false; - } - } - - private static void addRevisedRecipes() - { - if (okayToTweakEnderStorage) - EnderStorageTweaks.addRecipes(); - - if (okayToTweakBigReactors) - BigReactorsTweaks.addRecipes(); - - if (okayToTweakDA) - DATweaks.addRecipes(); - - if (okayToTweakSFM) - SFMTweaks.addRecipes(); - - if (okayToTweakOpenBlocks) - OpenBlocksTweaks.addRecipes(); - - if (okayToTweakAM2) - AM2Tweaks.addRecipes(); - - if (okayToTweakMPSA) - MPSATweaks.addRecipes(); - - if (okayToTweakMekanism && ConfigurationHandler.harderDisassemblerRecipe) - MekanismTweaks.addRecipes(); - - if (okayToTweakTE && ConfigurationHandler.harderActivatorRecipe) - TETweaks.addRecipes(); - - if (okayToTweakMagicalCrops) - MagicropsTweaks.addRecipes(); - - if (okayToTweakMagicalCrops && okayToTweakIC2) - MagicropsAndIC2Tweaks.addRecipes(); - - if (okayToTweakMagicalCrops && okayToTweakTE) - MagicropsAndTETweaks.addRecipes(); - - if (okayToTweakReliquary) - ReliquaryTweaks.addRecipes(); - - if (okayToTweakExU) - ExUTweaks.addRecipes(); - - if (okayToTweakJABBA) - JABBATweaks.addRecipes(); - - if (okayToTweakMFR) - MFRTweaks.addRecipes(); - - if (okayToTweakEnderIO) - EnderIOTweaks.addRecipes(); - - GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); - } - - /** - * Adds aluminIUM oreDict registries to aluminUM as well - */ + @SuppressWarnings("unchecked") private static void doOreDictTweaks() { + // cross registering alumin(um/ium) for (ItemStack s : OreDictionary.getOres("dustAluminium")) { OreDictionary.registerOre("dustAluminum", s); } + // fixing zinc smelting List dirtyZincs = OreDictionary.getOres("dustImpureZinc"); for (ItemStack stack : dirtyZincs) { @@ -297,11 +43,8 @@ private static void doOreDictTweaks() for (ItemStack stack1 : OreDictionary.getOres("ingotZinc")) FurnaceRecipes.smelting().addSmelting(newStack.itemID, newStack.getItemDamage(), stack1.copy(), 0.1F); } - } - - @SuppressWarnings("unchecked") - public static void fixFusedQuartz() - { + + // fixing fused quartz try { int id = OreDictionary.getOreID("glassHardened"); @@ -322,4 +65,93 @@ public static void fixFusedQuartz() t.printStackTrace(); } } + + private static void addMiscRecipes() + { + GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); + } + + public static void removeRecipes() + { + try + { + ClassPath classpath = ClassPath.from(RecipeTweaks.class.getClassLoader()); + Set classes = classpath.getTopLevelClasses("tppitweaks.recipetweaks.modTweaks"); + + for (ClassInfo c : classes) + { + Class clazz = c.load(); + for (Method m : clazz.getDeclaredMethods()) + { + RecipeRemoval r = m.getAnnotation(RecipeRemoval.class); + System.out.println(c.getName() + " : " + m.getName() + " : " + Arrays.deepToString(m.getDeclaredAnnotations())); + if (r != null && allModsLoaded(r.requiredModids())) + { + m.invoke(null, new Object[]{}); + } + } + } + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Could not perform recipe removals. This is a serious error!"); + t.printStackTrace(); + throw new RuntimeException("Recipe tweaks failed."); + } + + TweakingRegistry.removeRecipes(); + } + + public static void addRecipes(EventTime time) + { + try + { + ClassPath classpath = ClassPath.from(RecipeTweaks.class.getClassLoader()); + Set classes = classpath.getTopLevelClasses("tppitweaks.recipetweaks.modTweaks"); + + for (ClassInfo c : classes) + { + Class clazz = c.load(); + for (Method m : clazz.getDeclaredMethods()) + { + RecipeAddition r = m.getAnnotation(RecipeAddition.class); + if (r != null && allModsLoaded(r.requiredModids()) && r.time() == time) + { + m.invoke(null, new Object[]{}); + } + } + } + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Could not perform recipe additions. This is a serious error!"); + t.printStackTrace(); + throw new RuntimeException("Recipe tweaks failed."); + } + } + + public static void doRemainingTweaks(EventTime time) + { + switch(time) + { + case INIT: + addMiscRecipes(); + break; + case POST_INIT: + doOreDictTweaks(); + break; + default: + break; + } + } + + private static boolean allModsLoaded(String[] modids) + { + for (String s : modids) + { + if (!Loader.isModLoaded(s)) + return false; + } + return true; + } } diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java new file mode 100644 index 0000000..7d7d277 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -0,0 +1,53 @@ +package tppitweaks.recipetweaks; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.ListIterator; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + +public class TweakingRegistry +{ + private static HashMap> recipesToRemove = new HashMap>(); + + public static void markItemForRecipeRemoval(int id, int meta) { + if(!recipesToRemove.containsKey(id)) { + recipesToRemove.put(id, new HashSet()); + } + recipesToRemove.get(id).add(meta); + } + + public static HashSet getDamageValuesToRemove(int itemID) { + return recipesToRemove.get(itemID); + } + + @SuppressWarnings({ "unchecked" }) + static void removeRecipes() + { + ListIterator iterator = CraftingManager.getInstance().getRecipeList().listIterator(); + while (iterator.hasNext()) + { + IRecipe r = iterator.next(); + if (canRemoveRecipe(r)) + { + iterator.remove(); + } + } + } + + private static boolean canRemoveRecipe(IRecipe r) + { + try + { + ItemStack output = r.getRecipeOutput(); + HashSet validMetas = getDamageValuesToRemove(output.itemID); + return validMetas.contains(-1) || validMetas.contains(output.getItemDamage()); + } + catch (Throwable e) + { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java index 23b363c..ce03add 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java @@ -1,13 +1,20 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; public class AM2Tweaks { + @RecipeAddition(requiredModids="AM2") public static void addRecipes() { - GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), 'P', - new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); + if (ConfigurationHandler.tweakAM2) + { + GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), + 'P', new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java index 3f04979..dfc0676 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java @@ -1,12 +1,15 @@ package tppitweaks.recipetweaks.modTweaks; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; public class AdvancedGeneticsTweaks { + @RecipeRemoval(requiredModids="advancedgenetics") public static void init() { if(ConfigurationHandler.disableAGAutoOutputter) { - TweakerBase.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index f6dac01..b2a675d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -2,27 +2,33 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.registry.GameRegistry; public class BigReactorsTweaks { - + + @RecipeRemoval(requiredModids="BigReactors") public static void init() { - if (ConfigurationHandler.steelReactorCasings) + if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { - TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); } if (ConfigurationHandler.glassFuelRods) { - TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); } } + @RecipeAddition(requiredModids="BigReactors") public static void addRecipes() { - if (ConfigurationHandler.steelReactorCasings) + if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { ItemStack reactorPartStack = ((erogenousbeef.bigreactors.common.multiblock.block.BlockReactorPart) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).getReactorCasingItemStack(); reactorPartStack.stackSize = 4; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java index aacfc67..f95ffe6 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,15 +12,18 @@ public class DATweaks { + @RecipeRemoval(requiredModids="DimensionalAnchors") public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) mods.immibis.chunkloader.DimensionalAnchors.instance.block).blockID, -1); + if (ConfigurationHandler.tweakDA) + TweakingRegistry.markItemForRecipeRemoval(((Block) mods.immibis.chunkloader.DimensionalAnchors.instance.block).blockID, -1); } + @RecipeAddition(requiredModids="DimensionalAnchors") public static void addRecipes() { - GameRegistry.addRecipe(new ItemStack(mods.immibis.chunkloader.DimensionalAnchors.instance.block, 1, 0), "ded", "oIo", "gog", 'd', Item.diamond, 'e', Item.enderPearl, 'o', Block.obsidian, 'I', Block.blockIron, - 'g', Item.ingotGold); + if(ConfigurationHandler.tweakDA) + GameRegistry.addRecipe(new ItemStack(mods.immibis.chunkloader.DimensionalAnchors.instance.block, 1, 0), "ded", "oIo", "gog", 'd', Item.diamond, 'e', Item.enderPearl, 'o', Block.obsidian, 'I', Block.blockIron,'g', Item.ingotGold); } public static void addTooltip(ItemTooltipEvent event) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java index 4bd76cd..034400d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java @@ -2,13 +2,16 @@ import net.minecraft.item.Item; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import bluedart.item.DartItem; public class DCTweaks { + @RecipeRemoval(requiredModids="DartCraft") public static void init() { if (ConfigurationHandler.disableForceShears && DartItem.forceShears != null) - TweakerBase.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java index 79a458c..e75100b 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java @@ -4,21 +4,27 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import crazypants.enderio.Config; import crazypants.enderio.EnderIO; public class EnderIOTweaks { + @RecipeRemoval(requiredModids="EnderIO") public static void init() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) { - TweakerBase.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); - TweakerBase.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); } + } + @RecipeAddition(requiredModids="EnderIO") public static void addRecipes() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java index 3394f41..7f3fcc7 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java @@ -4,17 +4,22 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; -public class EnderStorageTweaks extends TweakerBase +public class EnderStorageTweaks extends TweakingRegistry { + @RecipeRemoval(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); if (ConfigurationHandler.enderPouchNerf) - TweakerBase.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); } + @RecipeAddition(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void addRecipes() { Object chestEnderElement = ConfigurationHandler.enderChestTesseract ? thermalexpansion.block.TEBlocks.blockTesseract : Item.enderPearl; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index 88135fe..663a195 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -12,52 +12,31 @@ import tppitweaks.block.ModBlocks; import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class ExUTweaks { + @RecipeRemoval(requiredModids="ExtraUtilities") public static void init() { if(ConfigurationHandler.nerfEnderQuarry) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); } if(ConfigurationHandler.nerfRedstoneGen) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); } if(ConfigurationHandler.nerfEnderGen && !OreDictionary.getOres("blockEnderium").isEmpty()) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); } } @SuppressWarnings("unchecked") - public static void fixRecipes() - { - try - { - TPPITweaks.logger.info("You made me do this, RwTema, know that ;_;"); - TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); - Field f = OreDictionary.class.getDeclaredField("oreIDs"); - f.setAccessible(true); - HashMap temp = (HashMap) f.get(null); - temp.remove("blockUnstable"); - temp.remove("burntquartz"); - temp.remove("icestone"); - f.set(null, temp); - } - catch (Throwable t) - { - t.printStackTrace(); - } - - OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); - OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); - OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); - - if (Loader.isModLoaded("gregtech_addon")) - TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); - } - + @RecipeAddition(requiredModids="ExtraUtilities") public static void addRecipes() { if(ConfigurationHandler.nerfEnderQuarry) { @@ -148,9 +127,36 @@ public static void addRecipes() { )); } + if (ConfigurationHandler.fixExURecipes) + { + try + { + TPPITweaks.logger.info("You made me do this, RwTema, know that ;_;"); + TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); + Field f = OreDictionary.class.getDeclaredField("oreIDs"); + f.setAccessible(true); + HashMap temp = (HashMap) f.get(null); + temp.remove("blockUnstable"); + temp.remove("burntquartz"); + temp.remove("icestone"); + f.set(null, temp); + } + catch (Throwable t) + { + t.printStackTrace(); + } + + OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); + OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); + OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); + + if (Loader.isModLoaded("gregtech_addon")) + TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); + } } - public static void reAddRecipeAfterLoad() + @RecipeAddition(requiredModids="ExtraUtilities", time=EventTime.PLAYER_JOIN) + public static void doPostLoadRecipeAdditions() { GameRegistry.addRecipe(new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5), "iii", "iii", "iii", 'i', extrautils.ExtraUtils.unstableIngot); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index dfd8d86..62c35eb 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -8,14 +8,17 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class GregtechTweaks { + @RecipeRemoval(requiredModids={"IC2", "gregtech_addon"}) public static void doStuff() { - if (ConfigurationHandler.addOsmiumToOreWasher && Loader.isModLoaded("IC2") && !OreDictionary.getOres("dustImpureOsmium").isEmpty() && !OreDictionary.getOres("dustOsmium").isEmpty()) { ic2.core.block.machine.tileentity.TileEntityOreWashing.addRecipe("dustImpureOsmium", 1, 1000, new ItemStack[] { OreDictionary.getOres("dustOsmium").get(0), ic2.core.Ic2Items.stoneDust }); @@ -70,7 +73,8 @@ public static void doStuff() } } - public static void addRecipes() { + @RecipeAddition(time=EventTime.PLAYER_JOIN, requiredModids={"IC2", "gregtech_addon"}) + public static void doPostLoadRecipeAdditions() { if(ConfigurationHandler.unnerfPaperRecipe) { GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}); TETweaks.addRecipes(); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java index 94515da..d769e84 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java @@ -8,25 +8,31 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class IC2Tweaks { + @RecipeRemoval(requiredModids="IC2") public static void init() { if (ConfigurationHandler.removeStupidEnergyCrystalRecipe) - TweakerBase.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.weedEx).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.suBattery).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.weedEx).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.suBattery).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); } + @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) public static void registerOres() { if (ConfigurationHandler.ic2TEGlassInterchangeability) @@ -46,6 +52,7 @@ public static void registerOres() } } + @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) public static void addRecipes() { if(ConfigurationHandler.doCharcoalBlockCompression) { if(!OreDictionary.getOres("blockCharcoal").isEmpty()) { @@ -54,6 +61,7 @@ public static void addRecipes() { } } + @RecipeAddition(requiredModids="IC2", time=EventTime.PLAYER_JOIN) public static void doPostLoadRecipeAdditions() { /* copypasta code, ignore horrible formatting */ diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java index 3fbe70d..284b928 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -5,27 +5,36 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.setup.Machine; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import factorization.shared.Core; public class JABBATweaks { + @RecipeRemoval(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); + if (ConfigurationHandler.tweakJABBA) + TweakingRegistry.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); } + @RecipeAddition(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) public static void addRecipes() { - // This only works for oak barrels - GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, - "wBw", - "wUw", - "www", + if (ConfigurationHandler.tweakJABBA) + { + GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, + "wBw", + "wUw", + "www", - 'w', "plankWood", - 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), - 'U', Machine.Unifier.getItemStack() - )); + 'w', "plankWood", + 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), + 'U', Machine.Unifier.getItemStack() + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index 93e8d42..f86479f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -5,34 +5,44 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.MineFactoryReloadedCore; import powercrystals.minefactoryreloaded.setup.Machine; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.registry.GameRegistry; public class MFRTweaks { + @RecipeRemoval(requiredModids="MineFactoryReloaded") public static void init() { - TweakerBase.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); + if (ConfigurationHandler.buffUnifierRecipe) + TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); } + @RecipeAddition(requiredModids="MineFactoryReloaded") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), - "RRR", - "SSS", - - 'R', "sheetPlastic", - 'S', "stone" - )); - - GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), - "RRR", - "rCr", - " M ", - - 'R', "sheetPlastic", - 'r', Item.redstone, - 'C', Item.comparator, - 'M', MineFactoryReloadedCore.machineBaseItem - )); + if (ConfigurationHandler.buffUnifierRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), + "RRR", + "SSS", + + 'R', "sheetPlastic", + 'S', "stone" + )); + + GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), + "RRR", + "rCr", + " M ", + + 'R', "sheetPlastic", + 'r', Item.redstone, + 'C', Item.comparator, + 'M', MineFactoryReloadedCore.machineBaseItem + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java index 3811731..99f1c90 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; @@ -8,84 +12,64 @@ public class MPSATweaks { private static ItemStack solarPanel, magnet, computerChip; + @RecipeRemoval(requiredModids="powersuitaddons") public static void init() { solarPanel = andrew.powersuits.common.AddonComponent.solarPanel; magnet = andrew.powersuits.common.AddonComponent.magnet; computerChip = andrew.powersuits.common.AddonComponent.computerChip; - - //removeRecipes(); - - TweakerBase.markItemForRecipeRemoval(solarPanel.itemID, 17); - TweakerBase.markItemForRecipeRemoval(magnet.itemID, 18); - TweakerBase.markItemForRecipeRemoval(computerChip.itemID, 19); - } - - /*@SuppressWarnings("unchecked") - private static void removeRecipes() - { - Iterator iter = CraftingManager.getInstance().getRecipeList().listIterator(); - - while (iter.hasNext()) + + if (ConfigurationHandler.changeMPSARecipes) { - IRecipe recipe = iter.next(); - if (recipe.getRecipeOutput() != null && recipe.getRecipeOutput().itemID == solarPanel.itemID && matchesDamage(recipe)) - { - iter.remove(); - } + TweakingRegistry.markItemForRecipeRemoval(solarPanel.itemID, 17); + TweakingRegistry.markItemForRecipeRemoval(magnet.itemID, 18); + TweakingRegistry.markItemForRecipeRemoval(computerChip.itemID, 19); } } - private static boolean matchesDamage(IRecipe recipe) + @RecipeAddition(requiredModids="powersuitaddons") + public static void addRecipes() { - int[] damages = {17,18,19}; - for (int i : damages) + if (ConfigurationHandler.changeMPSARecipes) { - if (i == recipe.getRecipeOutput().getItemDamage()) - return true; + ItemStack powerCoilGold = thermalexpansion.item.TEItems.powerCoilGold; + ItemStack powerCoilSilver = thermalexpansion.item.TEItems.powerCoilSilver; + ItemStack powerCoilElectrum = thermalexpansion.item.TEItems.powerCoilElectrum; + + GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, new Object[]{ + "GGG", + "PPP", + "WWW", + + 'G', "glassHardened", + 'P', "ingotPlatinum", + 'W', "componentWiring" + })); + + GameRegistry.addRecipe(new ShapedOreRecipe(magnet, new Object[]{ + "IRI", + "SSS", + "sRs", + + 'I', "ingotInvar", + 'R', powerCoilGold, + 'S', "componentSolenoid", + 's', "ingotSteel" + + })); + + GameRegistry.addRecipe(new ShapedOreRecipe(computerChip, new Object[]{ + "SC ", + "RIT", + "WWW", + + 'S', "componentSolenoid", + 'C', powerCoilElectrum, + 'R', powerCoilGold, + 'I', new ItemStack(buildcraft.BuildCraftSilicon.redstoneChipset, 1, 1), + 'T', powerCoilSilver, + 'W', "componentWiring" + })); } - return false; - }*/ - - public static void addRecipes() - { - ItemStack powerCoilGold = thermalexpansion.item.TEItems.powerCoilGold; - ItemStack powerCoilSilver = thermalexpansion.item.TEItems.powerCoilSilver; - ItemStack powerCoilElectrum = thermalexpansion.item.TEItems.powerCoilElectrum; - - GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, new Object[]{ - "GGG", - "PPP", - "WWW", - - 'G', "glassHardened", - 'P', "ingotPlatinum", - 'W', "componentWiring" - })); - - GameRegistry.addRecipe(new ShapedOreRecipe(magnet, new Object[]{ - "IRI", - "SSS", - "sRs", - - 'I', "ingotInvar", - 'R', powerCoilGold, - 'S', "componentSolenoid", - 's', "ingotSteel" - - })); - - GameRegistry.addRecipe(new ShapedOreRecipe(computerChip, new Object[]{ - "SC ", - "RIT", - "WWW", - - 'S', "componentSolenoid", - 'C', powerCoilElectrum, - 'R', powerCoilGold, - 'I', new ItemStack(buildcraft.BuildCraftSilicon.redstoneChipset, 1, 1), - 'T', powerCoilSilver, - 'W', "componentWiring" - })); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java index 9a3e4cf..37af86d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java @@ -1,9 +1,11 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; public class MagicropsAndIC2Tweaks { + @RecipeAddition(requiredModids={"magicalcrops", "IC2"}) public static void addRecipes() { ic2.core.block.machine.tileentity.TileEntityMacerator.addRecipe("oreMCropsEssence", 1, new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0)); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java index 757df33..7fa8e0f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java @@ -1,10 +1,12 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class MagicropsAndTETweaks { + @RecipeAddition(requiredModids={"magicalcrops", "ThermalExpansion"}) public static void addRecipes() { thermalexpansion.util.crafting.PulverizerManager.addRecipe(2400, OreDictionary.getOres("oreMCropsEssence").get(0), new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0), new ItemStack(magicalcrops.mod_mCrops.CropEssence, 1, 0), 5); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java index 915bb23..1cc7d75 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java @@ -5,23 +5,29 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class MagicropsTweaks { + @RecipeRemoval(requiredModids="magicalcrops") public static void init() { - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEssence.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsDiamond.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEmerald.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsXP.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsThaumcraftShard.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsCobalt.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsArdite.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsPlatinum.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsUranium.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEssence.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsDiamond.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEmerald.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsXP.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsThaumcraftShard.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsCobalt.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsArdite.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsPlatinum.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsUranium.itemID, -1); } + @RecipeAddition(requiredModids="magicalcrops", time=EventTime.INIT) public static void registerOres() { if (ConfigurationHandler.registerMagicalCropsOre) @@ -31,6 +37,7 @@ public static void registerOres() } } + @RecipeAddition(requiredModids="magicalcrops") public static void addRecipes() { if (ConfigurationHandler.addEssenceSeedRecipe) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index 9f44ee4..98d6aa6 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -8,27 +8,32 @@ import net.minecraftforge.oredict.OreDictionary; import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class MekanismTweaks { + @RecipeRemoval(requiredModids="Mekanism") public static void init() { if (ConfigurationHandler.harderDisassemblerRecipe) { - TweakerBase.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); } if (ConfigurationHandler.disableCardboardBox) { - TweakerBase.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); } if (ConfigurationHandler.disableMiner || ConfigurationHandler.nerfMiner) { - TweakerBase.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); } } + @RecipeAddition(requiredModids="Mekanism") public static void addRecipes() { if (ConfigurationHandler.harderDisassemblerRecipe) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java index a4e4993..5f7ee97 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,17 +12,25 @@ public class OpenBlocksTweaks { + @RecipeRemoval(requiredModids="OpenBlocks") public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + if (ConfigurationHandler.eloraamBreakersAndDeployers) + { + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + } } + @RecipeAddition(requiredModids="OpenBlocks") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, 'P', - Block.pistonBase, 'R', Item.redstone })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', - Block.pistonBase, 'R', Item.redstone })); + if (ConfigurationHandler.eloraamBreakersAndDeployers) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, + 'P', Block.pistonBase, 'R', Item.redstone })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', + Block.pistonBase, 'R', Item.redstone })); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java index a484aae..afc8095 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java @@ -1,5 +1,7 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import mods.railcraft.common.items.ItemPlate; import mods.railcraft.common.items.ItemPlate.EnumPlate; import net.minecraft.item.ItemStack; @@ -8,6 +10,7 @@ public class RailcraftTweaks { + @RecipeAddition(requiredModids={"Railcraft"}, time=EventTime.PLAYER_JOIN) public static void registerOres() { // Please don't kill me CJ diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java index 7d2726f..f8c073e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -7,21 +11,27 @@ public class ReliquaryTweaks { + @RecipeRemoval(requiredModids="xreliquary") public static void init() { - TweakerBase.markItemForRecipeRemoval(xreliquary.items.XRItems.condensedPotion.itemID, 10); + if (ConfigurationHandler.harderLillipadRecipe) + TweakingRegistry.markItemForRecipeRemoval(xreliquary.items.XRItems.condensedPotion.itemID, 10); } + @RecipeAddition(requiredModids="xreliquary") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(xreliquary.items.XRItems.condensedPotion, 1, 10), new Object[]{ - "sap", - "aap", - "ppp", - - 's', xreliquary.items.XRItems.condensedPotion, - 'a', Item.appleGold, - 'p', new ItemStack(Item.dyePowder, 1, 15) - })); + if (ConfigurationHandler.harderLillipadRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(xreliquary.items.XRItems.condensedPotion, 1, 10), + "sap", + "aap", + "ppp", + + 's', xreliquary.items.XRItems.condensedPotion, + 'a', Item.appleGold, + 'p', new ItemStack(Item.dyePowder, 1, 15) + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java index c4167fc..07b0a25 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java @@ -4,73 +4,83 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapelessOreRecipe; +import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class SFMTweaks { + @RecipeRemoval(requiredModids={"AppliedEnergistics", "StevesFactoryManager"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); - - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + if (ConfigurationHandler.tweakSFM) + { + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + } } - + + @RecipeAddition(requiredModids={"AppliedEnergistics", "StevesFactoryManager"}) public static void addRecipes() { - GameRegistry.addRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockManager), new Object[] { "III", "IRI", "SPS", Character.valueOf('R'), new ItemStack(ModItems.tppiMaterial), + if (ConfigurationHandler.tweakSFM) + { + GameRegistry.addRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockManager), new Object[] { "III", "IRI", "SPS", Character.valueOf('R'), new ItemStack(ModItems.tppiMaterial), Character.valueOf('P'), appeng.api.Materials.matConversionMatrix.copy(), Character.valueOf('I'), Item.ingotIron, Character.valueOf('S'), Block.stone }); - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCable, 8), - new Object[] { "GPG", "IRI", "GPG", Character.valueOf('R'), appeng.api.Materials.matFluxDust.copy(), Character.valueOf('G'), Block.glass, Character.valueOf('I'), Item.ingotIron, + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCable, 8), + new Object[] { "GPG", "IRI", "GPG", Character.valueOf('R'), appeng.api.Materials.matFluxDust.copy(), Character.valueOf('G'), Block.glass, Character.valueOf('I'), Item.ingotIron, Character.valueOf('P'), Block.pressurePlateIron }); - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableRelay, 1, 8), - new Object[]{ - "fBf", - "BIB", - "fBf", - - 'B', Block.blockLapis, - 'I', vswe.stevesfactory.blocks.Blocks.blockCableRelay, - 'f', appeng.api.Materials.matFluxDust.copy() - }); - - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableInput), - new Object[]{ - " r ", - "rIr", - " r ", - - 'r', Item.redstone, - 'I', vswe.stevesfactory.blocks.Blocks.blockCable - }); - - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableOutput), - new Object[]{ - "rtr", - "rIr", - "rrr", - - 'r', Item.redstone, - 't', appeng.api.Blocks.blkLevelEmitter.copy(), - 'I', vswe.stevesfactory.blocks.Blocks.blockCable - }); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), vswe.stevesfactory.blocks.Blocks.blockCable, Block.hopperBlock, Block.dropper, appeng.api.Blocks.blkInterface.copy())); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 8), new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), appeng.api.Materials.matProcessorBasic.copy())); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableBreaker), vswe.stevesfactory.blocks.Blocks.blockCable, Item.pickaxeIron, Block.dispenser, appeng.api.Blocks.blkInterface.copy())); - + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableRelay, 1, 8), + new Object[]{ + "fBf", + "BIB", + "fBf", + + 'B', Block.blockLapis, + 'I', vswe.stevesfactory.blocks.Blocks.blockCableRelay, + 'f', appeng.api.Materials.matFluxDust.copy() + }); + + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableInput), + new Object[]{ + " r ", + "rIr", + " r ", + + 'r', Item.redstone, + 'I', vswe.stevesfactory.blocks.Blocks.blockCable + }); + + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableOutput), + new Object[]{ + "rtr", + "rIr", + "rrr", + + 'r', Item.redstone, + 't', appeng.api.Blocks.blkLevelEmitter.copy(), + 'I', vswe.stevesfactory.blocks.Blocks.blockCable + }); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), vswe.stevesfactory.blocks.Blocks.blockCable, Block.hopperBlock, Block.dropper, appeng.api.Blocks.blkInterface.copy())); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 8), new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), appeng.api.Materials.matProcessorBasic.copy())); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableBreaker), vswe.stevesfactory.blocks.Blocks.blockCable, Item.pickaxeIron, Block.dispenser, appeng.api.Blocks.blkInterface.copy())); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java index 6b2c64c..c60e52c 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java @@ -1,5 +1,10 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.TPPITweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -9,27 +14,36 @@ public class TETweaks { + @RecipeRemoval(requiredModids="ThermalExpansion") public static void init() { - TweakerBase.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); + if (ConfigurationHandler.harderActivatorRecipe) + TweakingRegistry.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); } + @RecipeAddition(requiredModids="ThermalExpansion") public static void addRecipes() { try { GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips}); - }catch(Throwable t) {} + }catch(Throwable t){ + TPPITweaks.logger.severe("Could not add paper recipe to pulverizer!"); + t.printStackTrace(); + } - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(thermalexpansion.block.TEBlocks.blockDevice.blockID, 1, 2), new Object[]{ - "scs", - "tpt", - "sns", - - 's', "ingotSteel", - 'p', Block.pistonBase, - 't', "ingotTin", - 'c', Block.chest, - 'n', thermalexpansion.item.TEItems.pneumaticServo - })); + if (ConfigurationHandler.harderActivatorRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(thermalexpansion.block.TEBlocks.blockDevice.blockID, 1, 2), new Object[]{ + "scs", + "tpt", + "sns", + + 's', OreDictionary.getOres("ingotSteel").isEmpty() ? "ingotIron" : "ingotSteel", + 'p', Block.pistonBase, + 't', "ingotTin", + 'c', Block.chest, + 'n', thermalexpansion.item.TEItems.pneumaticServo + })); + } if (OreDictionary.getOres("dustRuby").size() != 0) thermalexpansion.util.crafting.PulverizerManager.addIngotNameToDustRecipe(2400, "gemRuby", OreDictionary.getOres("dustRuby").get(0)); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java deleted file mode 100644 index b870b51..0000000 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java +++ /dev/null @@ -1,21 +0,0 @@ -package tppitweaks.recipetweaks.modTweaks; - -import java.util.HashMap; -import java.util.HashSet; - -public class TweakerBase -{ - private static HashMap> recipesToRemove = new HashMap>(); - - public static void markItemForRecipeRemoval(int id, int meta) { - if(!recipesToRemove.containsKey(id)) { - recipesToRemove.put(id, new HashSet()); - } - recipesToRemove.get(id).add(meta); - } - - public static HashSet getDamageValuesToRemove(int itemID) { - return recipesToRemove.get(itemID); - } - -} \ No newline at end of file From 8e2373696ef98ba09d63011866b60f63c5f70cfc Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sat, 5 Apr 2014 04:35:29 -0400 Subject: [PATCH 17/35] Completely refactory tweaking system. - Now uses annotations, completely automated. --- src/main/java/tppitweaks/TPPITweaks.java | 20 +- .../tppitweaks/client/gui/MaricultureGui.java | 2 +- .../tppitweaks/event/TPPIEventHandler.java | 6 +- .../recipetweaks/RecipeAddition.java | 26 ++ .../recipetweaks/RecipeRemoval.java | 19 + .../tppitweaks/recipetweaks/RecipeTweaks.java | 372 +++++------------- .../recipetweaks/TweakingRegistry.java | 53 +++ .../recipetweaks/modTweaks/AM2Tweaks.java | 11 +- .../modTweaks/AdvancedGeneticsTweaks.java | 5 +- .../modTweaks/BigReactorsTweaks.java | 16 +- .../recipetweaks/modTweaks/DATweaks.java | 13 +- .../recipetweaks/modTweaks/DCTweaks.java | 5 +- .../recipetweaks/modTweaks/EnderIOTweaks.java | 10 +- .../modTweaks/EnderStorageTweaks.java | 11 +- .../recipetweaks/modTweaks/ExUTweaks.java | 70 ++-- .../modTweaks/GregtechTweaks.java | 8 +- .../recipetweaks/modTweaks/IC2Tweaks.java | 24 +- .../recipetweaks/modTweaks/JABBATweaks.java | 29 +- .../recipetweaks/modTweaks/MFRTweaks.java | 48 ++- .../recipetweaks/modTweaks/MPSATweaks.java | 118 +++--- .../modTweaks/MagicropsAndIC2Tweaks.java | 2 + .../modTweaks/MagicropsAndTETweaks.java | 2 + .../modTweaks/MagicropsTweaks.java | 25 +- .../modTweaks/MekanismTweaks.java | 13 +- .../modTweaks/OpenBlocksTweaks.java | 24 +- .../modTweaks/RailcraftTweaks.java | 3 + .../modTweaks/ReliquaryTweaks.java | 30 +- .../recipetweaks/modTweaks/SFMTweaks.java | 118 +++--- .../recipetweaks/modTweaks/TETweaks.java | 40 +- .../recipetweaks/modTweaks/TweakerBase.java | 21 - 30 files changed, 595 insertions(+), 549 deletions(-) create mode 100644 src/main/java/tppitweaks/recipetweaks/RecipeAddition.java create mode 100644 src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java create mode 100644 src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java delete mode 100644 src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index bed06ca..03a7868 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -18,6 +18,7 @@ import tppitweaks.proxy.CommonProxy; import tppitweaks.proxy.PacketHandler; import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.util.FileLoader; import tppitweaks.util.TPPIPlayerTracker; import cpw.mods.fml.common.FMLCommonHandler; @@ -83,9 +84,6 @@ public void preInit(FMLPreInitializationEvent event) @EventHandler public void init(FMLInitializationEvent event) { - if (ConfigurationHandler.unregisterFusedQuartz) - RecipeTweaks.fixFusedQuartz(); - // AM2SpawnControls.doAM2SpawnControls(); eventHandler = new TPPIEventHandler(); @@ -95,13 +93,13 @@ public void init(FMLInitializationEvent event) if (event.getSide().isClient()) proxy.initTickHandler(); + + tweakAtEvent(EventTime.INIT); } @EventHandler public void postInit(FMLPostInitializationEvent event) { - RecipeTweaks.doPostInitRecipeTweaks(); - if (FMLCommonHandler.instance().getSide().isClient()) { try @@ -113,6 +111,8 @@ public void postInit(FMLPostInitializationEvent event) e.printStackTrace(); } } + + tweakAtEvent(EventTime.POST_INIT); } @EventHandler @@ -120,4 +120,14 @@ public void onFMLServerStart(FMLServerStartingEvent event) { event.registerServerCommand(new CommandTPPI()); } + + public static void tweakAtEvent(EventTime event) + { + if (event == EventTime.POST_INIT) + RecipeTweaks.removeRecipes(); + + RecipeTweaks.addRecipes(event); + + RecipeTweaks.doRemainingTweaks(event); + } } diff --git a/src/main/java/tppitweaks/client/gui/MaricultureGui.java b/src/main/java/tppitweaks/client/gui/MaricultureGui.java index 716d212..df84f84 100644 --- a/src/main/java/tppitweaks/client/gui/MaricultureGui.java +++ b/src/main/java/tppitweaks/client/gui/MaricultureGui.java @@ -55,7 +55,7 @@ protected void actionPerformed(GuiButton button) this.mc.displayGuiScreen(null); break; case 4: - ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false"); + ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false"); this.mc.displayGuiScreen(null); break; default: diff --git a/src/main/java/tppitweaks/event/TPPIEventHandler.java b/src/main/java/tppitweaks/event/TPPIEventHandler.java index ffff947..3792fb2 100644 --- a/src/main/java/tppitweaks/event/TPPIEventHandler.java +++ b/src/main/java/tppitweaks/event/TPPIEventHandler.java @@ -20,6 +20,7 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.lib.Reference; import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.modTweaks.DATweaks; import com.google.common.collect.ImmutableList; @@ -186,6 +187,9 @@ public void onItemTooltip(ItemTooltipEvent event) @ForgeSubscribe public void onPlayerJoin(EntityJoinWorldEvent event) { if (!RecipeTweaks.recipesInitialized) - RecipeTweaks.doPlayerJoinRecipeTweaks(); + { + TPPITweaks.tweakAtEvent(EventTime.PLAYER_JOIN); + RecipeTweaks.recipesInitialized = true; + } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java b/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java new file mode 100644 index 0000000..7d5b58e --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/RecipeAddition.java @@ -0,0 +1,26 @@ +package tppitweaks.recipetweaks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a method as one that removes a recipe + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RecipeAddition +{ + public enum EventTime { INIT, POST_INIT, PLAYER_JOIN } + + /** + * The event at which this method is to be executed + */ + EventTime time() default EventTime.POST_INIT; + + /** + * The modids that must be loaded for this method to execute + */ + String[] requiredModids() default {}; +} diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java b/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java new file mode 100644 index 0000000..db30366 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/RecipeRemoval.java @@ -0,0 +1,19 @@ +package tppitweaks.recipetweaks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a method as one that removes recipes + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RecipeRemoval +{ + /** + * The modids that must be loaded for this method to execute + */ + String[] requiredModids() default {}; +} diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java index d51470a..458d696 100644 --- a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java @@ -1,295 +1,41 @@ package tppitweaks.recipetweaks; import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.ListIterator; +import java.util.Set; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.TPPITweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.modTweaks.*; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; + +import com.google.common.reflect.ClassPath; +import com.google.common.reflect.ClassPath.ClassInfo; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class RecipeTweaks { - public static boolean recipesInitialized; - private static boolean okayToTweakIC2; - private static boolean okayToTweakGT; - private static boolean okayToTweakEnderStorage; - private static boolean okayToTweakBigReactors; - private static boolean okayToTweakDA; - private static boolean okayToTweakSFM; - private static boolean okayToTweakOpenBlocks; - private static boolean okayToTweakAM2; - private static boolean okayToTweakMagicalCrops; - private static boolean okayToTweakDartCraft; - private static boolean okayToTweakExU; - private static boolean okayToTweakMPSA; - private static boolean okayToTweakMekanism; - private static boolean okayToTweakTE; - private static boolean okayToTweakReliquary; - private static boolean okayToTweakAdvancedGenetics; - private static boolean okayToTweakRailcraft; - private static boolean okayToTweakJABBA; - private static boolean okayToTweakMFR; - private static boolean okayToTweakEnderIO; - - public static void doPostInitRecipeTweaks() - { - recipesInitialized = false; - - checkWhatWeCanTweak(); - initRemovableRecipesMap(); - - if (okayToTweakGT) - GregtechTweaks.doStuff(); - - if (okayToTweakExU && ConfigurationHandler.fixExURecipes) - ExUTweaks.fixRecipes(); - - doOreDictTweaks(); - - if (okayToTweakIC2) { - IC2Tweaks.registerOres(); - IC2Tweaks.addRecipes(); - } - - if (okayToTweakMagicalCrops) - MagicropsTweaks.registerOres(); - - removeSomeRecipes(); - addRevisedRecipes(); - } - - public static void doPlayerJoinRecipeTweaks() - { - if (okayToTweakGT) - { - GregtechTweaks.addRecipes(); - } - if (okayToTweakExU) - { - ExUTweaks.reAddRecipeAfterLoad(); - } - if (okayToTweakRailcraft) - { - RailcraftTweaks.registerOres(); - } - if (okayToTweakIC2) - { - IC2Tweaks.doPostLoadRecipeAdditions(); - } - recipesInitialized = true; - } - - @SuppressWarnings({ "unchecked" }) - private static void removeSomeRecipes() - { - ListIterator iterator = CraftingManager.getInstance().getRecipeList().listIterator(); - while (iterator.hasNext()) - { - IRecipe r = iterator.next(); - if (canRemoveRecipe(r)) - { - iterator.remove(); - } - } - } - - private static void checkWhatWeCanTweak() - { - okayToTweakIC2 = Loader.isModLoaded("IC2"); - okayToTweakGT = Loader.isModLoaded("gregtech_addon"); - okayToTweakEnderStorage = Loader.isModLoaded("EnderStorage") && Loader.isModLoaded("ThermalExpansion"); - okayToTweakBigReactors = Loader.isModLoaded("BigReactors") && !OreDictionary.getOres("ingotSteel").isEmpty() - && (ConfigurationHandler.steelReactorCasings || ConfigurationHandler.glassFuelRods); - okayToTweakDA = Loader.isModLoaded("DimensionalAnchors") && ConfigurationHandler.tweakDA; - okayToTweakSFM = Loader.isModLoaded("AppliedEnergistics") && Loader.isModLoaded("StevesFactoryManager") && ConfigurationHandler.tweakSFM; - okayToTweakOpenBlocks = Loader.isModLoaded("OpenBlocks") && ConfigurationHandler.eloraamBreakersAndDeployers; - okayToTweakAM2 = Loader.isModLoaded("arsmagica2") && ConfigurationHandler.tweakAM2; - okayToTweakMagicalCrops = Loader.isModLoaded("magicalcrops"); - okayToTweakDartCraft = Loader.isModLoaded("DartCraft") && ConfigurationHandler.removeStupidEnergyCrystalRecipe; - okayToTweakExU = Loader.isModLoaded("ExtraUtilities"); - okayToTweakMPSA = Loader.isModLoaded("powersuitaddons") && ConfigurationHandler.changeMPSARecipes; - okayToTweakMekanism = Loader.isModLoaded("Mekanism"); - okayToTweakTE = Loader.isModLoaded("ThermalExpansion"); - okayToTweakReliquary = Loader.isModLoaded("xreliquary") && ConfigurationHandler.harderLillipadRecipe; - okayToTweakAdvancedGenetics = Loader.isModLoaded("advancedgenetics"); - okayToTweakRailcraft = Loader.isModLoaded("Railcraft"); - okayToTweakJABBA = ConfigurationHandler.tweakJABBA && Loader.isModLoaded("factorization") && Loader.isModLoaded("MineFactoryReloaded") && Loader.isModLoaded("JABBA"); - okayToTweakMFR = ConfigurationHandler.buffUnifierRecipe && Loader.isModLoaded("MineFactoryReloaded"); - okayToTweakEnderIO = Loader.isModLoaded("EnderIO"); - } - - private static void initRemovableRecipesMap() - { - /* - * Value -1 for key means no metadata sensitivity. Value = metadata for - * metadata sensitivity. - */ - - if (okayToTweakEnderStorage) - { - EnderStorageTweaks.init(); - } - if (okayToTweakBigReactors) - { - BigReactorsTweaks.init(); - } - if (okayToTweakDA) - { - DATweaks.init(); - } - if (okayToTweakSFM) - { - SFMTweaks.init(); - } - if (okayToTweakOpenBlocks) - { - OpenBlocksTweaks.init(); - } - if (Loader.isModLoaded("ExtraUtilities")) - { - ExUTweaks.init(); - } - if (okayToTweakAdvancedGenetics) - { - AdvancedGeneticsTweaks.init(); - } - if (okayToTweakDartCraft) - { - DCTweaks.init(); - } - if (okayToTweakIC2) - { - IC2Tweaks.init(); - } - if (okayToTweakMPSA) - { - MPSATweaks.init(); - } - if (okayToTweakMekanism) - { - MekanismTweaks.init(); - } - if (okayToTweakTE && ConfigurationHandler.harderActivatorRecipe) - { - TETweaks.init(); - } - if (okayToTweakMagicalCrops) - { - MagicropsTweaks.init(); - } - if (okayToTweakReliquary) - { - ReliquaryTweaks.init(); - } - if (okayToTweakJABBA) - { - JABBATweaks.init(); - } - if (okayToTweakMFR) - { - MFRTweaks.init(); - } - if (okayToTweakEnderIO) - { - EnderIOTweaks.init(); - } - } - - private static boolean canRemoveRecipe(IRecipe r) - { - try - { - ItemStack output = r.getRecipeOutput(); - HashSet validMetas = TweakerBase.getDamageValuesToRemove(output.itemID); - return validMetas.contains(-1) || validMetas.contains(output.getItemDamage()); - } - catch (Throwable e) - { - return false; - } - } - - private static void addRevisedRecipes() - { - if (okayToTweakEnderStorage) - EnderStorageTweaks.addRecipes(); - - if (okayToTweakBigReactors) - BigReactorsTweaks.addRecipes(); - - if (okayToTweakDA) - DATweaks.addRecipes(); - - if (okayToTweakSFM) - SFMTweaks.addRecipes(); - - if (okayToTweakOpenBlocks) - OpenBlocksTweaks.addRecipes(); - - if (okayToTweakAM2) - AM2Tweaks.addRecipes(); - - if (okayToTweakMPSA) - MPSATweaks.addRecipes(); - - if (okayToTweakMekanism && ConfigurationHandler.harderDisassemblerRecipe) - MekanismTweaks.addRecipes(); - - if (okayToTweakTE && ConfigurationHandler.harderActivatorRecipe) - TETweaks.addRecipes(); - - if (okayToTweakMagicalCrops) - MagicropsTweaks.addRecipes(); - - if (okayToTweakMagicalCrops && okayToTweakIC2) - MagicropsAndIC2Tweaks.addRecipes(); - - if (okayToTweakMagicalCrops && okayToTweakTE) - MagicropsAndTETweaks.addRecipes(); - - if (okayToTweakReliquary) - ReliquaryTweaks.addRecipes(); - - if (okayToTweakExU) - ExUTweaks.addRecipes(); - - if (okayToTweakJABBA) - JABBATweaks.addRecipes(); - - if (okayToTweakMFR) - MFRTweaks.addRecipes(); - - if (okayToTweakEnderIO) - EnderIOTweaks.addRecipes(); - - GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); - } - - /** - * Adds aluminIUM oreDict registries to aluminUM as well - */ + @SuppressWarnings("unchecked") private static void doOreDictTweaks() { + // cross registering alumin(um/ium) for (ItemStack s : OreDictionary.getOres("dustAluminium")) { OreDictionary.registerOre("dustAluminum", s); } + // fixing zinc smelting List dirtyZincs = OreDictionary.getOres("dustImpureZinc"); for (ItemStack stack : dirtyZincs) { @@ -297,11 +43,8 @@ private static void doOreDictTweaks() for (ItemStack stack1 : OreDictionary.getOres("ingotZinc")) FurnaceRecipes.smelting().addSmelting(newStack.itemID, newStack.getItemDamage(), stack1.copy(), 0.1F); } - } - - @SuppressWarnings("unchecked") - public static void fixFusedQuartz() - { + + // fixing fused quartz try { int id = OreDictionary.getOreID("glassHardened"); @@ -322,4 +65,93 @@ public static void fixFusedQuartz() t.printStackTrace(); } } + + private static void addMiscRecipes() + { + GameRegistry.addRecipe(new ShapelessOreRecipe(Item.flintAndSteel, new Object[]{"nuggetSteel", Item.flint})); + } + + public static void removeRecipes() + { + try + { + ClassPath classpath = ClassPath.from(RecipeTweaks.class.getClassLoader()); + Set classes = classpath.getTopLevelClasses("tppitweaks.recipetweaks.modTweaks"); + + for (ClassInfo c : classes) + { + Class clazz = c.load(); + for (Method m : clazz.getDeclaredMethods()) + { + RecipeRemoval r = m.getAnnotation(RecipeRemoval.class); + System.out.println(c.getName() + " : " + m.getName() + " : " + Arrays.deepToString(m.getDeclaredAnnotations())); + if (r != null && allModsLoaded(r.requiredModids())) + { + m.invoke(null, new Object[]{}); + } + } + } + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Could not perform recipe removals. This is a serious error!"); + t.printStackTrace(); + throw new RuntimeException("Recipe tweaks failed."); + } + + TweakingRegistry.removeRecipes(); + } + + public static void addRecipes(EventTime time) + { + try + { + ClassPath classpath = ClassPath.from(RecipeTweaks.class.getClassLoader()); + Set classes = classpath.getTopLevelClasses("tppitweaks.recipetweaks.modTweaks"); + + for (ClassInfo c : classes) + { + Class clazz = c.load(); + for (Method m : clazz.getDeclaredMethods()) + { + RecipeAddition r = m.getAnnotation(RecipeAddition.class); + if (r != null && allModsLoaded(r.requiredModids()) && r.time() == time) + { + m.invoke(null, new Object[]{}); + } + } + } + } + catch (Throwable t) + { + TPPITweaks.logger.severe("Could not perform recipe additions. This is a serious error!"); + t.printStackTrace(); + throw new RuntimeException("Recipe tweaks failed."); + } + } + + public static void doRemainingTweaks(EventTime time) + { + switch(time) + { + case INIT: + addMiscRecipes(); + break; + case POST_INIT: + doOreDictTweaks(); + break; + default: + break; + } + } + + private static boolean allModsLoaded(String[] modids) + { + for (String s : modids) + { + if (!Loader.isModLoaded(s)) + return false; + } + return true; + } } diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java new file mode 100644 index 0000000..7d7d277 --- /dev/null +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -0,0 +1,53 @@ +package tppitweaks.recipetweaks; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.ListIterator; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + +public class TweakingRegistry +{ + private static HashMap> recipesToRemove = new HashMap>(); + + public static void markItemForRecipeRemoval(int id, int meta) { + if(!recipesToRemove.containsKey(id)) { + recipesToRemove.put(id, new HashSet()); + } + recipesToRemove.get(id).add(meta); + } + + public static HashSet getDamageValuesToRemove(int itemID) { + return recipesToRemove.get(itemID); + } + + @SuppressWarnings({ "unchecked" }) + static void removeRecipes() + { + ListIterator iterator = CraftingManager.getInstance().getRecipeList().listIterator(); + while (iterator.hasNext()) + { + IRecipe r = iterator.next(); + if (canRemoveRecipe(r)) + { + iterator.remove(); + } + } + } + + private static boolean canRemoveRecipe(IRecipe r) + { + try + { + ItemStack output = r.getRecipeOutput(); + HashSet validMetas = getDamageValuesToRemove(output.itemID); + return validMetas.contains(-1) || validMetas.contains(output.getItemDamage()); + } + catch (Throwable e) + { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java index 23b363c..ce03add 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java @@ -1,13 +1,20 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; public class AM2Tweaks { + @RecipeAddition(requiredModids="AM2") public static void addRecipes() { - GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), 'P', - new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); + if (ConfigurationHandler.tweakAM2) + { + GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), + 'P', new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java index 3f04979..dfc0676 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java @@ -1,12 +1,15 @@ package tppitweaks.recipetweaks.modTweaks; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; public class AdvancedGeneticsTweaks { + @RecipeRemoval(requiredModids="advancedgenetics") public static void init() { if(ConfigurationHandler.disableAGAutoOutputter) { - TweakerBase.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index f6dac01..b2a675d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -2,27 +2,33 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.registry.GameRegistry; public class BigReactorsTweaks { - + + @RecipeRemoval(requiredModids="BigReactors") public static void init() { - if (ConfigurationHandler.steelReactorCasings) + if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { - TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); } if (ConfigurationHandler.glassFuelRods) { - TweakerBase.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); } } + @RecipeAddition(requiredModids="BigReactors") public static void addRecipes() { - if (ConfigurationHandler.steelReactorCasings) + if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { ItemStack reactorPartStack = ((erogenousbeef.bigreactors.common.multiblock.block.BlockReactorPart) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).getReactorCasingItemStack(); reactorPartStack.stackSize = 4; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java index aacfc67..f95ffe6 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,15 +12,18 @@ public class DATweaks { + @RecipeRemoval(requiredModids="DimensionalAnchors") public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) mods.immibis.chunkloader.DimensionalAnchors.instance.block).blockID, -1); + if (ConfigurationHandler.tweakDA) + TweakingRegistry.markItemForRecipeRemoval(((Block) mods.immibis.chunkloader.DimensionalAnchors.instance.block).blockID, -1); } + @RecipeAddition(requiredModids="DimensionalAnchors") public static void addRecipes() { - GameRegistry.addRecipe(new ItemStack(mods.immibis.chunkloader.DimensionalAnchors.instance.block, 1, 0), "ded", "oIo", "gog", 'd', Item.diamond, 'e', Item.enderPearl, 'o', Block.obsidian, 'I', Block.blockIron, - 'g', Item.ingotGold); + if(ConfigurationHandler.tweakDA) + GameRegistry.addRecipe(new ItemStack(mods.immibis.chunkloader.DimensionalAnchors.instance.block, 1, 0), "ded", "oIo", "gog", 'd', Item.diamond, 'e', Item.enderPearl, 'o', Block.obsidian, 'I', Block.blockIron,'g', Item.ingotGold); } public static void addTooltip(ItemTooltipEvent event) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java index 4bd76cd..034400d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java @@ -2,13 +2,16 @@ import net.minecraft.item.Item; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import bluedart.item.DartItem; public class DCTweaks { + @RecipeRemoval(requiredModids="DartCraft") public static void init() { if (ConfigurationHandler.disableForceShears && DartItem.forceShears != null) - TweakerBase.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java index 79a458c..e75100b 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java @@ -4,21 +4,27 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import crazypants.enderio.Config; import crazypants.enderio.EnderIO; public class EnderIOTweaks { + @RecipeRemoval(requiredModids="EnderIO") public static void init() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) { - TweakerBase.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); - TweakerBase.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); } + } + @RecipeAddition(requiredModids="EnderIO") public static void addRecipes() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java index 3394f41..7f3fcc7 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java @@ -4,17 +4,22 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; -public class EnderStorageTweaks extends TweakerBase +public class EnderStorageTweaks extends TweakingRegistry { + @RecipeRemoval(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); if (ConfigurationHandler.enderPouchNerf) - TweakerBase.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); } + @RecipeAddition(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void addRecipes() { Object chestEnderElement = ConfigurationHandler.enderChestTesseract ? thermalexpansion.block.TEBlocks.blockTesseract : Item.enderPearl; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index 88135fe..663a195 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -12,52 +12,31 @@ import tppitweaks.block.ModBlocks; import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class ExUTweaks { + @RecipeRemoval(requiredModids="ExtraUtilities") public static void init() { if(ConfigurationHandler.nerfEnderQuarry) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); } if(ConfigurationHandler.nerfRedstoneGen) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); } if(ConfigurationHandler.nerfEnderGen && !OreDictionary.getOres("blockEnderium").isEmpty()) { - TweakerBase.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); } } @SuppressWarnings("unchecked") - public static void fixRecipes() - { - try - { - TPPITweaks.logger.info("You made me do this, RwTema, know that ;_;"); - TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); - Field f = OreDictionary.class.getDeclaredField("oreIDs"); - f.setAccessible(true); - HashMap temp = (HashMap) f.get(null); - temp.remove("blockUnstable"); - temp.remove("burntquartz"); - temp.remove("icestone"); - f.set(null, temp); - } - catch (Throwable t) - { - t.printStackTrace(); - } - - OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); - OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); - OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); - - if (Loader.isModLoaded("gregtech_addon")) - TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); - } - + @RecipeAddition(requiredModids="ExtraUtilities") public static void addRecipes() { if(ConfigurationHandler.nerfEnderQuarry) { @@ -148,9 +127,36 @@ public static void addRecipes() { )); } + if (ConfigurationHandler.fixExURecipes) + { + try + { + TPPITweaks.logger.info("You made me do this, RwTema, know that ;_;"); + TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); + Field f = OreDictionary.class.getDeclaredField("oreIDs"); + f.setAccessible(true); + HashMap temp = (HashMap) f.get(null); + temp.remove("blockUnstable"); + temp.remove("burntquartz"); + temp.remove("icestone"); + f.set(null, temp); + } + catch (Throwable t) + { + t.printStackTrace(); + } + + OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); + OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); + OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); + + if (Loader.isModLoaded("gregtech_addon")) + TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); + } } - public static void reAddRecipeAfterLoad() + @RecipeAddition(requiredModids="ExtraUtilities", time=EventTime.PLAYER_JOIN) + public static void doPostLoadRecipeAdditions() { GameRegistry.addRecipe(new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5), "iii", "iii", "iii", 'i', extrautils.ExtraUtils.unstableIngot); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index dfd8d86..62c35eb 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -8,14 +8,17 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class GregtechTweaks { + @RecipeRemoval(requiredModids={"IC2", "gregtech_addon"}) public static void doStuff() { - if (ConfigurationHandler.addOsmiumToOreWasher && Loader.isModLoaded("IC2") && !OreDictionary.getOres("dustImpureOsmium").isEmpty() && !OreDictionary.getOres("dustOsmium").isEmpty()) { ic2.core.block.machine.tileentity.TileEntityOreWashing.addRecipe("dustImpureOsmium", 1, 1000, new ItemStack[] { OreDictionary.getOres("dustOsmium").get(0), ic2.core.Ic2Items.stoneDust }); @@ -70,7 +73,8 @@ public static void doStuff() } } - public static void addRecipes() { + @RecipeAddition(time=EventTime.PLAYER_JOIN, requiredModids={"IC2", "gregtech_addon"}) + public static void doPostLoadRecipeAdditions() { if(ConfigurationHandler.unnerfPaperRecipe) { GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}); TETweaks.addRecipes(); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java index 94515da..d769e84 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java @@ -8,25 +8,31 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; public class IC2Tweaks { + @RecipeRemoval(requiredModids="IC2") public static void init() { if (ConfigurationHandler.removeStupidEnergyCrystalRecipe) - TweakerBase.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.weedEx).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.suBattery).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.weedEx).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.suBattery).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); } + @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) public static void registerOres() { if (ConfigurationHandler.ic2TEGlassInterchangeability) @@ -46,6 +52,7 @@ public static void registerOres() } } + @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) public static void addRecipes() { if(ConfigurationHandler.doCharcoalBlockCompression) { if(!OreDictionary.getOres("blockCharcoal").isEmpty()) { @@ -54,6 +61,7 @@ public static void addRecipes() { } } + @RecipeAddition(requiredModids="IC2", time=EventTime.PLAYER_JOIN) public static void doPostLoadRecipeAdditions() { /* copypasta code, ignore horrible formatting */ diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java index 3fbe70d..284b928 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -5,27 +5,36 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.setup.Machine; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; import factorization.shared.Core; public class JABBATweaks { + @RecipeRemoval(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); + if (ConfigurationHandler.tweakJABBA) + TweakingRegistry.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); } + @RecipeAddition(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) public static void addRecipes() { - // This only works for oak barrels - GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, - "wBw", - "wUw", - "www", + if (ConfigurationHandler.tweakJABBA) + { + GameRegistry.addRecipe(new ShapedOreRecipe(BetterBarrels.blockBarrel, + "wBw", + "wUw", + "www", - 'w', "plankWood", - 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), - 'U', Machine.Unifier.getItemStack() - )); + 'w', "plankWood", + 'B', new ItemStack(Core.registry.daybarrel, 1, OreDictionary.WILDCARD_VALUE), + 'U', Machine.Unifier.getItemStack() + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index 93e8d42..f86479f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -5,34 +5,44 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import powercrystals.minefactoryreloaded.MineFactoryReloadedCore; import powercrystals.minefactoryreloaded.setup.Machine; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.RecipeRemoval; import cpw.mods.fml.common.registry.GameRegistry; public class MFRTweaks { + @RecipeRemoval(requiredModids="MineFactoryReloaded") public static void init() { - TweakerBase.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); + if (ConfigurationHandler.buffUnifierRecipe) + TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); } + @RecipeAddition(requiredModids="MineFactoryReloaded") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), - "RRR", - "SSS", - - 'R', "sheetPlastic", - 'S', "stone" - )); - - GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), - "RRR", - "rCr", - " M ", - - 'R', "sheetPlastic", - 'r', Item.redstone, - 'C', Item.comparator, - 'M', MineFactoryReloadedCore.machineBaseItem - )); + if (ConfigurationHandler.buffUnifierRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(MineFactoryReloadedCore.machineBaseItem, 3), + "RRR", + "SSS", + + 'R', "sheetPlastic", + 'S', "stone" + )); + + GameRegistry.addRecipe(new ShapedOreRecipe(Machine.Unifier.getItemStack(), + "RRR", + "rCr", + " M ", + + 'R', "sheetPlastic", + 'r', Item.redstone, + 'C', Item.comparator, + 'M', MineFactoryReloadedCore.machineBaseItem + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java index 3811731..99f1c90 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; @@ -8,84 +12,64 @@ public class MPSATweaks { private static ItemStack solarPanel, magnet, computerChip; + @RecipeRemoval(requiredModids="powersuitaddons") public static void init() { solarPanel = andrew.powersuits.common.AddonComponent.solarPanel; magnet = andrew.powersuits.common.AddonComponent.magnet; computerChip = andrew.powersuits.common.AddonComponent.computerChip; - - //removeRecipes(); - - TweakerBase.markItemForRecipeRemoval(solarPanel.itemID, 17); - TweakerBase.markItemForRecipeRemoval(magnet.itemID, 18); - TweakerBase.markItemForRecipeRemoval(computerChip.itemID, 19); - } - - /*@SuppressWarnings("unchecked") - private static void removeRecipes() - { - Iterator iter = CraftingManager.getInstance().getRecipeList().listIterator(); - - while (iter.hasNext()) + + if (ConfigurationHandler.changeMPSARecipes) { - IRecipe recipe = iter.next(); - if (recipe.getRecipeOutput() != null && recipe.getRecipeOutput().itemID == solarPanel.itemID && matchesDamage(recipe)) - { - iter.remove(); - } + TweakingRegistry.markItemForRecipeRemoval(solarPanel.itemID, 17); + TweakingRegistry.markItemForRecipeRemoval(magnet.itemID, 18); + TweakingRegistry.markItemForRecipeRemoval(computerChip.itemID, 19); } } - private static boolean matchesDamage(IRecipe recipe) + @RecipeAddition(requiredModids="powersuitaddons") + public static void addRecipes() { - int[] damages = {17,18,19}; - for (int i : damages) + if (ConfigurationHandler.changeMPSARecipes) { - if (i == recipe.getRecipeOutput().getItemDamage()) - return true; + ItemStack powerCoilGold = thermalexpansion.item.TEItems.powerCoilGold; + ItemStack powerCoilSilver = thermalexpansion.item.TEItems.powerCoilSilver; + ItemStack powerCoilElectrum = thermalexpansion.item.TEItems.powerCoilElectrum; + + GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, new Object[]{ + "GGG", + "PPP", + "WWW", + + 'G', "glassHardened", + 'P', "ingotPlatinum", + 'W', "componentWiring" + })); + + GameRegistry.addRecipe(new ShapedOreRecipe(magnet, new Object[]{ + "IRI", + "SSS", + "sRs", + + 'I', "ingotInvar", + 'R', powerCoilGold, + 'S', "componentSolenoid", + 's', "ingotSteel" + + })); + + GameRegistry.addRecipe(new ShapedOreRecipe(computerChip, new Object[]{ + "SC ", + "RIT", + "WWW", + + 'S', "componentSolenoid", + 'C', powerCoilElectrum, + 'R', powerCoilGold, + 'I', new ItemStack(buildcraft.BuildCraftSilicon.redstoneChipset, 1, 1), + 'T', powerCoilSilver, + 'W', "componentWiring" + })); } - return false; - }*/ - - public static void addRecipes() - { - ItemStack powerCoilGold = thermalexpansion.item.TEItems.powerCoilGold; - ItemStack powerCoilSilver = thermalexpansion.item.TEItems.powerCoilSilver; - ItemStack powerCoilElectrum = thermalexpansion.item.TEItems.powerCoilElectrum; - - GameRegistry.addRecipe(new ShapedOreRecipe(solarPanel, new Object[]{ - "GGG", - "PPP", - "WWW", - - 'G', "glassHardened", - 'P', "ingotPlatinum", - 'W', "componentWiring" - })); - - GameRegistry.addRecipe(new ShapedOreRecipe(magnet, new Object[]{ - "IRI", - "SSS", - "sRs", - - 'I', "ingotInvar", - 'R', powerCoilGold, - 'S', "componentSolenoid", - 's', "ingotSteel" - - })); - - GameRegistry.addRecipe(new ShapedOreRecipe(computerChip, new Object[]{ - "SC ", - "RIT", - "WWW", - - 'S', "componentSolenoid", - 'C', powerCoilElectrum, - 'R', powerCoilGold, - 'I', new ItemStack(buildcraft.BuildCraftSilicon.redstoneChipset, 1, 1), - 'T', powerCoilSilver, - 'W', "componentWiring" - })); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java index 9a3e4cf..37af86d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java @@ -1,9 +1,11 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; public class MagicropsAndIC2Tweaks { + @RecipeAddition(requiredModids={"magicalcrops", "IC2"}) public static void addRecipes() { ic2.core.block.machine.tileentity.TileEntityMacerator.addRecipe("oreMCropsEssence", 1, new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0)); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java index 757df33..7fa8e0f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java @@ -1,10 +1,12 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class MagicropsAndTETweaks { + @RecipeAddition(requiredModids={"magicalcrops", "ThermalExpansion"}) public static void addRecipes() { thermalexpansion.util.crafting.PulverizerManager.addRecipe(2400, OreDictionary.getOres("oreMCropsEssence").get(0), new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0), new ItemStack(magicalcrops.mod_mCrops.CropEssence, 1, 0), 5); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java index 915bb23..1cc7d75 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsTweaks.java @@ -5,23 +5,29 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class MagicropsTweaks { + @RecipeRemoval(requiredModids="magicalcrops") public static void init() { - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEssence.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsDiamond.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEmerald.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsXP.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsThaumcraftShard.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsCobalt.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsArdite.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsPlatinum.itemID, -1); - TweakerBase.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsUranium.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEssence.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsDiamond.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsEmerald.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsXP.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsThaumcraftShard.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsCobalt.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsArdite.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsPlatinum.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(magicalcrops.mod_mCrops.mSeedsUranium.itemID, -1); } + @RecipeAddition(requiredModids="magicalcrops", time=EventTime.INIT) public static void registerOres() { if (ConfigurationHandler.registerMagicalCropsOre) @@ -31,6 +37,7 @@ public static void registerOres() } } + @RecipeAddition(requiredModids="magicalcrops") public static void addRecipes() { if (ConfigurationHandler.addEssenceSeedRecipe) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index 9f44ee4..98d6aa6 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -8,27 +8,32 @@ import net.minecraftforge.oredict.OreDictionary; import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class MekanismTweaks { + @RecipeRemoval(requiredModids="Mekanism") public static void init() { if (ConfigurationHandler.harderDisassemblerRecipe) { - TweakerBase.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); - TweakerBase.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); } if (ConfigurationHandler.disableCardboardBox) { - TweakerBase.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); } if (ConfigurationHandler.disableMiner || ConfigurationHandler.nerfMiner) { - TweakerBase.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); } } + @RecipeAddition(requiredModids="Mekanism") public static void addRecipes() { if (ConfigurationHandler.harderDisassemblerRecipe) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java index a4e4993..5f7ee97 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,17 +12,25 @@ public class OpenBlocksTweaks { + @RecipeRemoval(requiredModids="OpenBlocks") public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + if (ConfigurationHandler.eloraamBreakersAndDeployers) + { + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + } } + @RecipeAddition(requiredModids="OpenBlocks") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, 'P', - Block.pistonBase, 'R', Item.redstone })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', - Block.pistonBase, 'R', Item.redstone })); + if (ConfigurationHandler.eloraamBreakersAndDeployers) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, + 'P', Block.pistonBase, 'R', Item.redstone })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', + Block.pistonBase, 'R', Item.redstone })); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java index a484aae..afc8095 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java @@ -1,5 +1,7 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import mods.railcraft.common.items.ItemPlate; import mods.railcraft.common.items.ItemPlate.EnumPlate; import net.minecraft.item.ItemStack; @@ -8,6 +10,7 @@ public class RailcraftTweaks { + @RecipeAddition(requiredModids={"Railcraft"}, time=EventTime.PLAYER_JOIN) public static void registerOres() { // Please don't kill me CJ diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java index 7d2726f..f8c073e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java @@ -1,5 +1,9 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -7,21 +11,27 @@ public class ReliquaryTweaks { + @RecipeRemoval(requiredModids="xreliquary") public static void init() { - TweakerBase.markItemForRecipeRemoval(xreliquary.items.XRItems.condensedPotion.itemID, 10); + if (ConfigurationHandler.harderLillipadRecipe) + TweakingRegistry.markItemForRecipeRemoval(xreliquary.items.XRItems.condensedPotion.itemID, 10); } + @RecipeAddition(requiredModids="xreliquary") public static void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(xreliquary.items.XRItems.condensedPotion, 1, 10), new Object[]{ - "sap", - "aap", - "ppp", - - 's', xreliquary.items.XRItems.condensedPotion, - 'a', Item.appleGold, - 'p', new ItemStack(Item.dyePowder, 1, 15) - })); + if (ConfigurationHandler.harderLillipadRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(xreliquary.items.XRItems.condensedPotion, 1, 10), + "sap", + "aap", + "ppp", + + 's', xreliquary.items.XRItems.condensedPotion, + 'a', Item.appleGold, + 'p', new ItemStack(Item.dyePowder, 1, 15) + )); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java index c4167fc..07b0a25 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java @@ -4,73 +4,83 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapelessOreRecipe; +import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class SFMTweaks { + @RecipeRemoval(requiredModids={"AppliedEnergistics", "StevesFactoryManager"}) public static void init() { - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); - - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); - TweakerBase.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + if (ConfigurationHandler.tweakSFM) + { + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + } } - + + @RecipeAddition(requiredModids={"AppliedEnergistics", "StevesFactoryManager"}) public static void addRecipes() { - GameRegistry.addRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockManager), new Object[] { "III", "IRI", "SPS", Character.valueOf('R'), new ItemStack(ModItems.tppiMaterial), + if (ConfigurationHandler.tweakSFM) + { + GameRegistry.addRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockManager), new Object[] { "III", "IRI", "SPS", Character.valueOf('R'), new ItemStack(ModItems.tppiMaterial), Character.valueOf('P'), appeng.api.Materials.matConversionMatrix.copy(), Character.valueOf('I'), Item.ingotIron, Character.valueOf('S'), Block.stone }); - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCable, 8), - new Object[] { "GPG", "IRI", "GPG", Character.valueOf('R'), appeng.api.Materials.matFluxDust.copy(), Character.valueOf('G'), Block.glass, Character.valueOf('I'), Item.ingotIron, + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCable, 8), + new Object[] { "GPG", "IRI", "GPG", Character.valueOf('R'), appeng.api.Materials.matFluxDust.copy(), Character.valueOf('G'), Block.glass, Character.valueOf('I'), Item.ingotIron, Character.valueOf('P'), Block.pressurePlateIron }); - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableRelay, 1, 8), - new Object[]{ - "fBf", - "BIB", - "fBf", - - 'B', Block.blockLapis, - 'I', vswe.stevesfactory.blocks.Blocks.blockCableRelay, - 'f', appeng.api.Materials.matFluxDust.copy() - }); - - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableInput), - new Object[]{ - " r ", - "rIr", - " r ", - - 'r', Item.redstone, - 'I', vswe.stevesfactory.blocks.Blocks.blockCable - }); - - GameRegistry.addRecipe( - new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableOutput), - new Object[]{ - "rtr", - "rIr", - "rrr", - - 'r', Item.redstone, - 't', appeng.api.Blocks.blkLevelEmitter.copy(), - 'I', vswe.stevesfactory.blocks.Blocks.blockCable - }); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), vswe.stevesfactory.blocks.Blocks.blockCable, Block.hopperBlock, Block.dropper, appeng.api.Blocks.blkInterface.copy())); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 8), new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), appeng.api.Materials.matProcessorBasic.copy())); - - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableBreaker), vswe.stevesfactory.blocks.Blocks.blockCable, Item.pickaxeIron, Block.dispenser, appeng.api.Blocks.blkInterface.copy())); - + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableRelay, 1, 8), + new Object[]{ + "fBf", + "BIB", + "fBf", + + 'B', Block.blockLapis, + 'I', vswe.stevesfactory.blocks.Blocks.blockCableRelay, + 'f', appeng.api.Materials.matFluxDust.copy() + }); + + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableInput), + new Object[]{ + " r ", + "rIr", + " r ", + + 'r', Item.redstone, + 'I', vswe.stevesfactory.blocks.Blocks.blockCable + }); + + GameRegistry.addRecipe( + new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableOutput), + new Object[]{ + "rtr", + "rIr", + "rrr", + + 'r', Item.redstone, + 't', appeng.api.Blocks.blkLevelEmitter.copy(), + 'I', vswe.stevesfactory.blocks.Blocks.blockCable + }); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), vswe.stevesfactory.blocks.Blocks.blockCable, Block.hopperBlock, Block.dropper, appeng.api.Blocks.blkInterface.copy())); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 8), new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableIntake, 1, 0), appeng.api.Materials.matProcessorBasic.copy())); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(vswe.stevesfactory.blocks.Blocks.blockCableBreaker), vswe.stevesfactory.blocks.Blocks.blockCable, Item.pickaxeIron, Block.dispenser, appeng.api.Blocks.blkInterface.copy())); + } } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java index 6b2c64c..c60e52c 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java @@ -1,5 +1,10 @@ package tppitweaks.recipetweaks.modTweaks; +import tppitweaks.TPPITweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -9,27 +14,36 @@ public class TETweaks { + @RecipeRemoval(requiredModids="ThermalExpansion") public static void init() { - TweakerBase.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); + if (ConfigurationHandler.harderActivatorRecipe) + TweakingRegistry.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); } + @RecipeAddition(requiredModids="ThermalExpansion") public static void addRecipes() { try { GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips}); - }catch(Throwable t) {} + }catch(Throwable t){ + TPPITweaks.logger.severe("Could not add paper recipe to pulverizer!"); + t.printStackTrace(); + } - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(thermalexpansion.block.TEBlocks.blockDevice.blockID, 1, 2), new Object[]{ - "scs", - "tpt", - "sns", - - 's', "ingotSteel", - 'p', Block.pistonBase, - 't', "ingotTin", - 'c', Block.chest, - 'n', thermalexpansion.item.TEItems.pneumaticServo - })); + if (ConfigurationHandler.harderActivatorRecipe) + { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(thermalexpansion.block.TEBlocks.blockDevice.blockID, 1, 2), new Object[]{ + "scs", + "tpt", + "sns", + + 's', OreDictionary.getOres("ingotSteel").isEmpty() ? "ingotIron" : "ingotSteel", + 'p', Block.pistonBase, + 't', "ingotTin", + 'c', Block.chest, + 'n', thermalexpansion.item.TEItems.pneumaticServo + })); + } if (OreDictionary.getOres("dustRuby").size() != 0) thermalexpansion.util.crafting.PulverizerManager.addIngotNameToDustRecipe(2400, "gemRuby", OreDictionary.getOres("dustRuby").get(0)); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java deleted file mode 100644 index b870b51..0000000 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TweakerBase.java +++ /dev/null @@ -1,21 +0,0 @@ -package tppitweaks.recipetweaks.modTweaks; - -import java.util.HashMap; -import java.util.HashSet; - -public class TweakerBase -{ - private static HashMap> recipesToRemove = new HashMap>(); - - public static void markItemForRecipeRemoval(int id, int meta) { - if(!recipesToRemove.containsKey(id)) { - recipesToRemove.put(id, new HashSet()); - } - recipesToRemove.get(id).add(meta); - } - - public static HashSet getDamageValuesToRemove(int itemID) { - return recipesToRemove.get(itemID); - } - -} \ No newline at end of file From 3e193de1cc271b4df5e5ad72547ff3fcb6824c82 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 00:59:19 -0400 Subject: [PATCH 18/35] Add reasoning tooltips for tweaked items. Not utilized yet. --- .../tppitweaks/event/TPPIEventHandler.java | 20 ++++++++- .../recipetweaks/TweakingRegistry.java | 41 +++++++++++++++++++ .../recipetweaks/modTweaks/MFRTweaks.java | 2 +- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/main/java/tppitweaks/event/TPPIEventHandler.java b/src/main/java/tppitweaks/event/TPPIEventHandler.java index 3792fb2..f5cef4c 100644 --- a/src/main/java/tppitweaks/event/TPPIEventHandler.java +++ b/src/main/java/tppitweaks/event/TPPIEventHandler.java @@ -8,19 +8,24 @@ import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import org.lwjgl.input.Keyboard; + import tppitweaks.TPPITweaks; import tppitweaks.client.gui.GuiHelper; import tppitweaks.client.gui.MaricultureGui; import tppitweaks.client.gui.UpdateGui; import tppitweaks.config.ConfigurationHandler; import tppitweaks.lib.Reference; -import tppitweaks.recipetweaks.RecipeTweaks; import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeTweaks; +import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.modTweaks.DATweaks; import com.google.common.collect.ImmutableList; @@ -182,6 +187,19 @@ public void onItemTooltip(ItemTooltipEvent event) { DATweaks.addTooltip(event); } + + String[] lines = TweakingRegistry.getTooltip(event.itemStack.itemID, event.itemStack.getItemDamage()); + if (lines != null) + { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) + { + event.toolTip.add(EnumChatFormatting.AQUA + "Reason: "); + for (String s : lines) + event.toolTip.add(EnumChatFormatting.YELLOW + s); + } + else + event.toolTip.add(EnumChatFormatting.YELLOW + "Tweaked Item! - " + EnumChatFormatting.RED + "Shift " + EnumChatFormatting.YELLOW + "for Info"); + } } @ForgeSubscribe diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java index 7d7d277..0b04a49 100644 --- a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -11,6 +11,7 @@ public class TweakingRegistry { private static HashMap> recipesToRemove = new HashMap>(); + private static HashMap> removalReasons = new HashMap>(); public static void markItemForRecipeRemoval(int id, int meta) { if(!recipesToRemove.containsKey(id)) { @@ -19,6 +20,16 @@ public static void markItemForRecipeRemoval(int id, int meta) { recipesToRemove.get(id).add(meta); } + public static void markItemForRecipeRemoval(int id, int meta, String... reason) { + markItemForRecipeRemoval(id, meta); + + if (!removalReasons.containsKey(id)) + { + removalReasons.put(id, new HashMap()); + } + removalReasons.get(id).put(meta, reason); + } + public static HashSet getDamageValuesToRemove(int itemID) { return recipesToRemove.get(itemID); } @@ -50,4 +61,34 @@ private static boolean canRemoveRecipe(IRecipe r) return false; } } + + /** + * Whether or not this ID (and damage value) has been removed + * @param data
- [0] - ID + *
- [1] - damage (can be ommitted)

+ * No further data will be analyzed + */ + public static boolean contains(int id, int damage) + { + return removalReasons.get(id) != null && removalReasons.get(id).containsKey(damage); + } + + /** + * The tooltip associated with this ID/damage + * @param id + * @param damage - no sensitivity = -1 + * @return null if no tooltip associated + */ + public static String[] getTooltip(int id, int damage) + { + if (contains(id, damage)) + { + return removalReasons.get(id).get(damage); + } + else if (contains(id, -1)) + { + return removalReasons.get(id).get(-1); + } + return null; + } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index f86479f..ee700b1 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -17,7 +17,7 @@ public class MFRTweaks public static void init() { if (ConfigurationHandler.buffUnifierRecipe) - TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); + TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8, "Recipe cheapened for use", "in JABBA barrels"); } @RecipeAddition(requiredModids="MineFactoryReloaded") From 961e2227abca89e067eb38f46f5df3a64ec38a39 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 01:21:37 -0400 Subject: [PATCH 19/35] More customizable tooltips, began adding support. pls help me :< --- .../tppitweaks/event/TPPIEventHandler.java | 5 +-- .../recipetweaks/TweakingRegistry.java | 43 ++++++++++++++++--- .../recipetweaks/modTweaks/AM2Tweaks.java | 10 +++-- .../modTweaks/AdvancedGeneticsTweaks.java | 3 +- .../modTweaks/BigReactorsTweaks.java | 5 ++- .../recipetweaks/modTweaks/MFRTweaks.java | 3 +- 6 files changed, 53 insertions(+), 16 deletions(-) diff --git a/src/main/java/tppitweaks/event/TPPIEventHandler.java b/src/main/java/tppitweaks/event/TPPIEventHandler.java index f5cef4c..76c4e44 100644 --- a/src/main/java/tppitweaks/event/TPPIEventHandler.java +++ b/src/main/java/tppitweaks/event/TPPIEventHandler.java @@ -193,9 +193,8 @@ public void onItemTooltip(ItemTooltipEvent event) { if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { - event.toolTip.add(EnumChatFormatting.AQUA + "Reason: "); - for (String s : lines) - event.toolTip.add(EnumChatFormatting.YELLOW + s); + for (int i = 0; i < lines.length; i++) + event.toolTip.add((i == 0 ? EnumChatFormatting.AQUA : EnumChatFormatting.YELLOW)+ lines[i]); } else event.toolTip.add(EnumChatFormatting.YELLOW + "Tweaked Item! - " + EnumChatFormatting.RED + "Shift " + EnumChatFormatting.YELLOW + "for Info"); diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java index 0b04a49..a7e5b85 100644 --- a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -13,21 +13,52 @@ public class TweakingRegistry private static HashMap> recipesToRemove = new HashMap>(); private static HashMap> removalReasons = new HashMap>(); - public static void markItemForRecipeRemoval(int id, int meta) { + public enum TweakingAction + { + REMOVED("Removed:"), + CHANGED("Recipe Changed:"), + ADDED("Added:"); + + private String name; + + TweakingAction(String name) + { + this.name = name; + } + + @Override + public String toString() + { + return name; + } + } + + public static void markItemForRecipeRemoval(int id, int damage) { if(!recipesToRemove.containsKey(id)) { recipesToRemove.put(id, new HashSet()); } - recipesToRemove.get(id).add(meta); + recipesToRemove.get(id).add(damage); } - public static void markItemForRecipeRemoval(int id, int meta, String... reason) { - markItemForRecipeRemoval(id, meta); - + public static void markItemForRecipeRemoval(int id, int damage, TweakingAction action, String... reason) { + markItemForRecipeRemoval(id, damage); + addToolTipOnly(id, damage, action, reason); + } + + public static void addToolTipOnly(int id, int damage, TweakingAction action, String... reason) + { if (!removalReasons.containsKey(id)) { removalReasons.put(id, new HashMap()); } - removalReasons.get(id).put(meta, reason); + + String[] lines = new String[reason.length + 1]; + lines[0] = action.toString(); + + for (int i = 1; i < lines.length; i++) + lines[i] = reason[i - 1]; + + removalReasons.get(id).put(damage, lines); } public static HashSet getDamageValuesToRemove(int itemID) { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java index ce03add..1d265e3 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java @@ -1,9 +1,10 @@ package tppitweaks.recipetweaks.modTweaks; +import net.minecraft.item.ItemStack; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeRemoval; -import net.minecraft.item.ItemStack; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class AM2Tweaks @@ -11,9 +12,12 @@ public class AM2Tweaks @RecipeAddition(requiredModids="AM2") public static void addRecipes() { + ItemStack spawnEgg = new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12); + TweakingRegistry.addToolTipOnly(spawnEgg.itemID, spawnEgg.getItemDamage(), TweakingAction.ADDED, "To allow spawning", "of Nature Guardians", "Without killing dryads"); + if (ConfigurationHandler.tweakAM2) { - GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), + GameRegistry.addShapedRecipe(spawnEgg, new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), 'P', new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java index dfc0676..d29dd2a 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java @@ -3,13 +3,14 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; public class AdvancedGeneticsTweaks { @RecipeRemoval(requiredModids="advancedgenetics") public static void init() { if(ConfigurationHandler.disableAGAutoOutputter) { - TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1, TweakingAction.REMOVED, "Crashes the game"); } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index b2a675d..2590286 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -8,6 +8,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class BigReactorsTweaks { @@ -17,11 +18,11 @@ public static void init() { if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { - TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0, TweakingAction.CHANGED, "Recipe requires steel to", "make the mod later game"); } if (ConfigurationHandler.glassFuelRods) { - TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1, TweakingAction.CHANGED, "Recipe requires hardened glass", "to make the mod later game"); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index ee700b1..2feeabc 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -9,6 +9,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class MFRTweaks @@ -17,7 +18,7 @@ public class MFRTweaks public static void init() { if (ConfigurationHandler.buffUnifierRecipe) - TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8, "Recipe cheapened for use", "in JABBA barrels"); + TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8, TweakingAction.CHANGED, "Cheapened for use", "in JABBA barrels"); } @RecipeAddition(requiredModids="MineFactoryReloaded") From 32117f3204321490082ac0ac244d21a572328ffd Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 01:30:27 -0400 Subject: [PATCH 20/35] Manual Merge. --- src/main/java/tppitweaks/event/TPPIEventHandler.java | 4 ---- .../tppitweaks/recipetweaks/TweakingRegistry.java | 12 ------------ .../tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java | 12 ++---------- .../modTweaks/AdvancedGeneticsTweaks.java | 10 ++-------- .../recipetweaks/modTweaks/BigReactorsTweaks.java | 11 ----------- .../tppitweaks/recipetweaks/modTweaks/MFRTweaks.java | 7 ------- 6 files changed, 4 insertions(+), 52 deletions(-) diff --git a/src/main/java/tppitweaks/event/TPPIEventHandler.java b/src/main/java/tppitweaks/event/TPPIEventHandler.java index c8fb01c..76c4e44 100644 --- a/src/main/java/tppitweaks/event/TPPIEventHandler.java +++ b/src/main/java/tppitweaks/event/TPPIEventHandler.java @@ -25,11 +25,7 @@ import tppitweaks.lib.Reference; import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.RecipeTweaks; -<<<<<<< HEAD -import tppitweaks.recipetweaks.RecipeAddition.EventTime; -======= import tppitweaks.recipetweaks.TweakingRegistry; ->>>>>>> origin/TweakerOverhaul import tppitweaks.recipetweaks.modTweaks.DATweaks; import com.google.common.collect.ImmutableList; diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java index bbbeecb..a7e5b85 100644 --- a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -11,14 +11,6 @@ public class TweakingRegistry { private static HashMap> recipesToRemove = new HashMap>(); -<<<<<<< HEAD - - public static void markItemForRecipeRemoval(int id, int meta) { - if(!recipesToRemove.containsKey(id)) { - recipesToRemove.put(id, new HashSet()); - } - recipesToRemove.get(id).add(meta); -======= private static HashMap> removalReasons = new HashMap>(); public enum TweakingAction @@ -67,7 +59,6 @@ public static void addToolTipOnly(int id, int damage, TweakingAction action, Str lines[i] = reason[i - 1]; removalReasons.get(id).put(damage, lines); ->>>>>>> origin/TweakerOverhaul } public static HashSet getDamageValuesToRemove(int itemID) { @@ -101,8 +92,6 @@ private static boolean canRemoveRecipe(IRecipe r) return false; } } -<<<<<<< HEAD -======= /** * Whether or not this ID (and damage value) has been removed @@ -133,5 +122,4 @@ else if (contains(id, -1)) } return null; } ->>>>>>> origin/TweakerOverhaul } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java index 99bd723..0acf38d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java @@ -1,8 +1,5 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeRemoval; import net.minecraft.item.ItemStack; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; @@ -15,18 +12,13 @@ public class AM2Tweaks @RecipeAddition(requiredModids="AM2") public static void addRecipes() { -<<<<<<< HEAD - if (ConfigurationHandler.tweakAM2) - { - GameRegistry.addShapedRecipe(new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12), new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), -======= ItemStack spawnEgg = new ItemStack(am2.items.ItemsCommonProxy.spawnEgg, 1, 12); - TweakingRegistry.addToolTipOnly(spawnEgg.itemID, spawnEgg.getItemDamage(), TweakingAction.ADDED, "To allow spawning", "of Nature Guardians", "Without killing dryads"); if (ConfigurationHandler.tweakAM2) { + TweakingRegistry.addToolTipOnly(spawnEgg.itemID, spawnEgg.getItemDamage(), TweakingAction.ADDED, "To allow spawning", "of Nature Guardians", "Without killing dryads"); + GameRegistry.addShapedRecipe(spawnEgg, new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), ->>>>>>> origin/TweakerOverhaul 'P', new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java index c909423..2048b1e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java @@ -3,21 +3,15 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; -<<<<<<< HEAD -======= import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; ->>>>>>> origin/TweakerOverhaul public class AdvancedGeneticsTweaks { @RecipeRemoval(requiredModids="advancedgenetics") public static void init() { - if(ConfigurationHandler.disableAGAutoOutputter) { -<<<<<<< HEAD - TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1); -======= + if(ConfigurationHandler.disableAGAutoOutputter) + { TweakingRegistry.markItemForRecipeRemoval(com.advGenetics.AdvGenetics.autoOutputUpgrade.itemID, -1, TweakingAction.REMOVED, "Crashes the game"); ->>>>>>> origin/TweakerOverhaul } } } \ No newline at end of file diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index e2a0557..2590286 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -8,10 +8,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; -<<<<<<< HEAD -======= import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; ->>>>>>> origin/TweakerOverhaul import cpw.mods.fml.common.registry.GameRegistry; public class BigReactorsTweaks { @@ -21,19 +18,11 @@ public static void init() { if (ConfigurationHandler.steelReactorCasings && !OreDictionary.getOres("ingotSteel").isEmpty()) { -<<<<<<< HEAD - TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0); - } - if (ConfigurationHandler.glassFuelRods) - { - TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1); -======= TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockReactorPart).blockID, 0, TweakingAction.CHANGED, "Recipe requires steel to", "make the mod later game"); } if (ConfigurationHandler.glassFuelRods) { TweakingRegistry.markItemForRecipeRemoval(((Block) erogenousbeef.bigreactors.common.BigReactors.blockYelloriumFuelRod).blockID, -1, TweakingAction.CHANGED, "Recipe requires hardened glass", "to make the mod later game"); ->>>>>>> origin/TweakerOverhaul } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index 5347d6c..2feeabc 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -9,10 +9,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; -<<<<<<< HEAD -======= import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; ->>>>>>> origin/TweakerOverhaul import cpw.mods.fml.common.registry.GameRegistry; public class MFRTweaks @@ -21,11 +18,7 @@ public class MFRTweaks public static void init() { if (ConfigurationHandler.buffUnifierRecipe) -<<<<<<< HEAD - TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8); -======= TweakingRegistry.markItemForRecipeRemoval(Machine.Unifier.getBlockId(), 8, TweakingAction.CHANGED, "Cheapened for use", "in JABBA barrels"); ->>>>>>> origin/TweakerOverhaul } @RecipeAddition(requiredModids="MineFactoryReloaded") From e3204ab7767df50af0896049870f8899cb866d28 Mon Sep 17 00:00:00 2001 From: esKaayY Date: Sun, 6 Apr 2014 02:10:23 -0400 Subject: [PATCH 21/35] Tooltips a plenty, GO i r master coder now? --- .../recipetweaks/modTweaks/DCTweaks.java | 2 +- .../recipetweaks/modTweaks/EnderIOTweaks.java | 4 ++-- .../recipetweaks/modTweaks/EnderStorageTweaks.java | 4 ++-- .../recipetweaks/modTweaks/ExUTweaks.java | 8 ++++---- .../recipetweaks/modTweaks/GregtechTweaks.java | 2 +- .../recipetweaks/modTweaks/JABBATweaks.java | 2 +- .../recipetweaks/modTweaks/MekanismTweaks.java | 4 ++-- .../recipetweaks/modTweaks/OpenBlocksTweaks.java | 4 ++-- .../recipetweaks/modTweaks/SFMTweaks.java | 14 +++++++------- .../recipetweaks/modTweaks/TETweaks.java | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java index 034400d..9104844 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java @@ -12,6 +12,6 @@ public class DCTweaks { public static void init() { if (ConfigurationHandler.disableForceShears && DartItem.forceShears != null) - TweakingRegistry.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(((Item) DartItem.forceShears).itemID, 0, TweakingAction.REMOVED, "Crashes servers"); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java index e75100b..83cc7f2 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java @@ -18,8 +18,8 @@ public static void init() { if (ConfigurationHandler.makeEIOHardModeEasier && Config.useHardRecipes) { - TweakingRegistry.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.blockReservoir.blockID, -1, TweakingAction.CHANGED, "Easy 'hardmode' recipe"); + TweakingRegistry.markItemForRecipeRemoval(EnderIO.itemBasicCapacitor.itemID, 0, TweakingAction.CHANGED, "Easy 'hardmode' recipe"); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java index 7f3fcc7..ca7d21e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderStorageTweaks.java @@ -14,9 +14,9 @@ public class EnderStorageTweaks extends TweakingRegistry @RecipeRemoval(requiredModids={"EnderStorage", "ThermalExpansion"}) public static void init() { - TweakingRegistry.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) codechicken.enderstorage.EnderStorage.blockEnderChest).blockID, -1, TweakingAction.CHANGED, "Recipe requires tesseract", "because it is better than one", "and requires midgame materials"); if (ConfigurationHandler.enderPouchNerf) - TweakingRegistry.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) codechicken.enderstorage.EnderStorage.itemEnderPouch).itemID, -1, TweakingAction.CHANGED, "Recipe requires pyrotheum+ender bucket", "so it requires midgame infrastructure"); } @RecipeAddition(requiredModids={"EnderStorage", "ThermalExpansion"}) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index 663a195..a79650c 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -24,14 +24,14 @@ public class ExUTweaks @RecipeRemoval(requiredModids="ExtraUtilities") public static void init() { if(ConfigurationHandler.nerfEnderQuarry) { - TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.enderQuarry.blockID, -1, TweakingAction.CHANGED, "Recipe changed to better", "balance with BC quarry recipe"); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.decorative1Id, 11, TweakingAction.CHANGED, "Recipe changed for ender quarry"); } if(ConfigurationHandler.nerfRedstoneGen) { - TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 4, TweakingAction.CHANGED, "Recipe requires 2xcompressed redstone", "because it produces tonnes of RF"); } if(ConfigurationHandler.nerfEnderGen && !OreDictionary.getOres("blockEnderium").isEmpty()) { - TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3); + TweakingRegistry.markItemForRecipeRemoval(extrautils.ExtraUtils.generatorId, 3, TweakingAction.CHANGED, "Recipe requires enderium", "because it produces tonnes of RF"); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index 62c35eb..90ba9b8 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -76,7 +76,7 @@ public static void doStuff() @RecipeAddition(time=EventTime.PLAYER_JOIN, requiredModids={"IC2", "gregtech_addon"}) public static void doPostLoadRecipeAdditions() { if(ConfigurationHandler.unnerfPaperRecipe) { - GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}); + GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}, TweakingAction.ADDED, "Check recipe to ensure 3x output"); TETweaks.addRecipes(); GameRegistry.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"#", "#", "#", '#', Item.reed}); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java index 284b928..7b8d41b 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -18,7 +18,7 @@ public class JABBATweaks public static void init() { if (ConfigurationHandler.tweakJABBA) - TweakingRegistry.markItemForRecipeRemoval(BetterBarrels.barrelID, -1); + TweakingRegistry.markItemForRecipeRemoval(BetterBarrels.barrelID, -1, TweakingAction.CHANGED, "Recipe changed to reflect", "the title of 'better barrel'"); } @RecipeAddition(requiredModids={"JABBA", "factorization", "MineFactoryReloaded"}) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index 98d6aa6..97441ff 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -20,8 +20,8 @@ public static void init() { if (ConfigurationHandler.harderDisassemblerRecipe) { - TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1); - TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1, TweakingAction.CHANGED, "Recipe changed to ensure", "balance with all other tools"); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1, TweakingAction.CHANGED, "Recipe changed to further", "balance all of Mekanism"); } if (ConfigurationHandler.disableCardboardBox) { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java index 5f7ee97..59a20de 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java @@ -17,8 +17,8 @@ public static void init() { if (ConfigurationHandler.eloraamBreakersAndDeployers) { - TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1, TweakingAction.CHANGED, "Recipe changed to bring back", "RP2-like recipes"); + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1, TweakingAction.CHANGED, "Recipe changed to bring back", "RP2-like recipes"); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java index 07b0a25..bd80c6e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java @@ -18,14 +18,14 @@ public static void init() { if (ConfigurationHandler.tweakSFM) { - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8); - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockManager).blockID, -1, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCable).blockID, -1, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableRelay).blockID, 8, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableInput).blockID, -1, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableOutput).blockID, -1, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1); - TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableIntake).blockID, -1, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); + TweakingRegistry.markItemForRecipeRemoval(((Block) vswe.stevesfactory.blocks.Blocks.blockCableBreaker).blockID, -1, TweakingAction.CHANGED, "Recipe changed to be AE-like", "to balance the vast capabilities", "of this normally cheap mod"); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java index c60e52c..24fc8c3 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java @@ -18,7 +18,7 @@ public class TETweaks { public static void init() { if (ConfigurationHandler.harderActivatorRecipe) - TweakingRegistry.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2); + TweakingRegistry.markItemForRecipeRemoval(thermalexpansion.block.TEBlocks.blockDevice.blockID, 2, TweakingAction.CHANGED, "Recipe requires steel", "to make this a later game item"); } @RecipeAddition(requiredModids="ThermalExpansion") From a821c8fe8370309f02f0f199d6e2984ff8468c42 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 02:12:50 -0400 Subject: [PATCH 22/35] esKaayY you so silly --- src/main/java/tppitweaks/TPPITweaks.java | 2 +- .../java/tppitweaks/client/gui/MaricultureGui.java | 4 ++-- .../modTweaks/AdvancedGeneticsTweaks.java | 2 +- .../recipetweaks/modTweaks/BigReactorsTweaks.java | 2 +- .../tppitweaks/recipetweaks/modTweaks/DATweaks.java | 8 ++++---- .../tppitweaks/recipetweaks/modTweaks/DCTweaks.java | 1 + .../recipetweaks/modTweaks/EnderIOTweaks.java | 1 + .../tppitweaks/recipetweaks/modTweaks/ExUTweaks.java | 3 ++- .../recipetweaks/modTweaks/GregtechTweaks.java | 1 + .../tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java | 2 +- .../recipetweaks/modTweaks/JABBATweaks.java | 1 + .../tppitweaks/recipetweaks/modTweaks/MFRTweaks.java | 2 +- .../tppitweaks/recipetweaks/modTweaks/MPSATweaks.java | 4 ++-- .../recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java | 2 +- .../recipetweaks/modTweaks/MagicropsAndTETweaks.java | 2 +- .../recipetweaks/modTweaks/MekanismTweaks.java | 1 + .../recipetweaks/modTweaks/OpenBlocksTweaks.java | 9 +++++---- .../recipetweaks/modTweaks/RailcraftTweaks.java | 4 ++-- .../recipetweaks/modTweaks/ReliquaryTweaks.java | 6 +++--- .../tppitweaks/recipetweaks/modTweaks/SFMTweaks.java | 1 + .../tppitweaks/recipetweaks/modTweaks/TETweaks.java | 11 ++++++----- 21 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index 03a7868..82f7be6 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -17,8 +17,8 @@ import tppitweaks.lib.Reference; import tppitweaks.proxy.CommonProxy; import tppitweaks.proxy.PacketHandler; -import tppitweaks.recipetweaks.RecipeTweaks; import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeTweaks; import tppitweaks.util.FileLoader; import tppitweaks.util.TPPIPlayerTracker; import cpw.mods.fml.common.FMLCommonHandler; diff --git a/src/main/java/tppitweaks/client/gui/MaricultureGui.java b/src/main/java/tppitweaks/client/gui/MaricultureGui.java index df84f84..e378fe1 100644 --- a/src/main/java/tppitweaks/client/gui/MaricultureGui.java +++ b/src/main/java/tppitweaks/client/gui/MaricultureGui.java @@ -1,9 +1,9 @@ package tppitweaks.client.gui; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.util.FileLoader; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.util.FileLoader; public class MaricultureGui extends GuiScreen { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java index 2048b1e..bbf55ca 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AdvancedGeneticsTweaks.java @@ -1,8 +1,8 @@ package tppitweaks.recipetweaks.modTweaks; import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; public class AdvancedGeneticsTweaks { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index 2590286..dc0b114 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -6,8 +6,8 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java index f95ffe6..e45ef44 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DATweaks.java @@ -1,13 +1,13 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeRemoval; -import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class DATweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java index 9104844..9ee4900 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/DCTweaks.java @@ -4,6 +4,7 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import bluedart.item.DartItem; public class DCTweaks { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java index 83cc7f2..9825487 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/EnderIOTweaks.java @@ -7,6 +7,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; import crazypants.enderio.Config; import crazypants.enderio.EnderIO; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index a79650c..a5b459a 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -13,9 +13,10 @@ import tppitweaks.config.ConfigurationHandler; import tppitweaks.item.ModItems; import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; -import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index 90ba9b8..9cb3deb 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -11,6 +11,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java index d769e84..ceb3ba0 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java @@ -9,8 +9,8 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java index 7b8d41b..5ab075e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/JABBATweaks.java @@ -9,6 +9,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; import factorization.shared.Core; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java index 2feeabc..0be2489 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MFRTweaks.java @@ -7,8 +7,8 @@ import powercrystals.minefactoryreloaded.setup.Machine; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java index 99f1c90..ee79416 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MPSATweaks.java @@ -1,11 +1,11 @@ package tppitweaks.recipetweaks.modTweaks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.ShapedOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; public class MPSATweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java index 37af86d..8ba2057 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java @@ -1,7 +1,7 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; +import tppitweaks.recipetweaks.RecipeAddition; public class MagicropsAndIC2Tweaks { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java index 7fa8e0f..6f516b9 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java @@ -1,8 +1,8 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.recipetweaks.RecipeAddition; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import tppitweaks.recipetweaks.RecipeAddition; public class MagicropsAndTETweaks { diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index 97441ff..3766b9a 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -11,6 +11,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class MekanismTweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java index 59a20de..2b11572 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java @@ -1,13 +1,14 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeRemoval; -import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class OpenBlocksTweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java index afc8095..0864148 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java @@ -1,11 +1,11 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeAddition.EventTime; import mods.railcraft.common.items.ItemPlate; import mods.railcraft.common.items.ItemPlate.EnumPlate; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapelessOreRecipe; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeAddition.EventTime; import cpw.mods.fml.common.registry.GameRegistry; public class RailcraftTweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java index f8c073e..33d5f65 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ReliquaryTweaks.java @@ -1,12 +1,12 @@ package tppitweaks.recipetweaks.modTweaks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.ShapedOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; public class ReliquaryTweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java index bd80c6e..ff1cd74 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/SFMTweaks.java @@ -9,6 +9,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class SFMTweaks diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java index 24fc8c3..be23751 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/TETweaks.java @@ -1,15 +1,16 @@ package tppitweaks.recipetweaks.modTweaks; -import tppitweaks.TPPITweaks; -import tppitweaks.config.ConfigurationHandler; -import tppitweaks.recipetweaks.RecipeAddition; -import tppitweaks.recipetweaks.RecipeRemoval; -import tppitweaks.recipetweaks.TweakingRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; +import tppitweaks.TPPITweaks; +import tppitweaks.config.ConfigurationHandler; +import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.registry.GameRegistry; public class TETweaks { From b940cac6bc4452bfc9b41e545a300aadc620914b Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 02:18:55 -0400 Subject: [PATCH 23/35] Those are not recipe items. --- .../tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index 9cb3deb..2ce722c 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -11,6 +11,7 @@ import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeAddition.EventTime; import tppitweaks.recipetweaks.RecipeRemoval; +import tppitweaks.recipetweaks.TweakingRegistry; import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; @@ -77,7 +78,8 @@ public static void doStuff() @RecipeAddition(time=EventTime.PLAYER_JOIN, requiredModids={"IC2", "gregtech_addon"}) public static void doPostLoadRecipeAdditions() { if(ConfigurationHandler.unnerfPaperRecipe) { - GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}, TweakingAction.ADDED, "Check recipe to ensure 3x output"); + TweakingRegistry.addToolTipOnly(Item.paper.itemID, -1, TweakingAction.ADDED, "Check recipe to ensure 3x output"); + GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}); TETweaks.addRecipes(); GameRegistry.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"#", "#", "#", '#', Item.reed}); } From e2b69bf5b7856c1196f028be64e3b1f789b06ea0 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 02:32:52 -0400 Subject: [PATCH 24/35] Add DM tooltip. --- .../tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index 3766b9a..b3f5db8 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -21,8 +21,8 @@ public static void init() { if (ConfigurationHandler.harderDisassemblerRecipe) { - TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1, TweakingAction.CHANGED, "Recipe changed to ensure", "balance with all other tools"); - TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1, TweakingAction.CHANGED, "Recipe changed to further", "balance all of Mekanism"); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicDisassembler).itemID, -1, TweakingAction.CHANGED, "Changed to ensure", "balance with all other tools"); + TweakingRegistry.markItemForRecipeRemoval(((Item) mekanism.common.Mekanism.AtomicCore).itemID, -1, TweakingAction.CHANGED, "Changed to further", "balance all of Mekanism"); } if (ConfigurationHandler.disableCardboardBox) { @@ -30,7 +30,7 @@ public static void init() } if (ConfigurationHandler.disableMiner || ConfigurationHandler.nerfMiner) { - TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4); + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4, TweakingAction.CHANGED, "Changed to balance better", "with other quarry-like blocks"); } } From 7f5ac6e7d2b0201a9f2f8ca7e81df5f0a0759e5b Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sun, 6 Apr 2014 03:17:36 -0400 Subject: [PATCH 25/35] Some more information and an additional fixed IC2 recipe. --- .../java/tppitweaks/recipetweaks/TweakingRegistry.java | 10 +++++----- .../tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java | 2 +- .../recipetweaks/modTweaks/GregtechTweaks.java | 2 +- .../tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java | 6 +++++- .../recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java | 4 ++++ .../recipetweaks/modTweaks/MagicropsAndTETweaks.java | 4 ++++ .../recipetweaks/modTweaks/RailcraftTweaks.java | 6 ++++++ 7 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java index a7e5b85..030e3f6 100644 --- a/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java +++ b/src/main/java/tppitweaks/recipetweaks/TweakingRegistry.java @@ -40,23 +40,23 @@ public static void markItemForRecipeRemoval(int id, int damage) { recipesToRemove.get(id).add(damage); } - public static void markItemForRecipeRemoval(int id, int damage, TweakingAction action, String... reason) { + public static void markItemForRecipeRemoval(int id, int damage, TweakingAction action, String... details) { markItemForRecipeRemoval(id, damage); - addToolTipOnly(id, damage, action, reason); + addTweakedTooltip(id, damage, action, details); } - public static void addToolTipOnly(int id, int damage, TweakingAction action, String... reason) + public static void addTweakedTooltip(int id, int damage, TweakingAction action, String... details) { if (!removalReasons.containsKey(id)) { removalReasons.put(id, new HashMap()); } - String[] lines = new String[reason.length + 1]; + String[] lines = new String[details.length + 1]; lines[0] = action.toString(); for (int i = 1; i < lines.length; i++) - lines[i] = reason[i - 1]; + lines[i] = details[i - 1]; removalReasons.get(id).put(damage, lines); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java index 0acf38d..367a81f 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/AM2Tweaks.java @@ -16,7 +16,7 @@ public static void addRecipes() if (ConfigurationHandler.tweakAM2) { - TweakingRegistry.addToolTipOnly(spawnEgg.itemID, spawnEgg.getItemDamage(), TweakingAction.ADDED, "To allow spawning", "of Nature Guardians", "Without killing dryads"); + TweakingRegistry.addTweakedTooltip(spawnEgg.itemID, spawnEgg.getItemDamage(), TweakingAction.ADDED, "To allow spawning", "of Nature Guardians", "Without killing dryads"); GameRegistry.addShapedRecipe(spawnEgg, new Object[] { "CCC", "CPC", "CCC", 'C', new ItemStack(am2.items.ItemsCommonProxy.essence, 1, 5), 'P', new ItemStack(am2.blocks.BlocksCommonProxy.aum) }); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index 2ce722c..c3be29e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -78,7 +78,7 @@ public static void doStuff() @RecipeAddition(time=EventTime.PLAYER_JOIN, requiredModids={"IC2", "gregtech_addon"}) public static void doPostLoadRecipeAdditions() { if(ConfigurationHandler.unnerfPaperRecipe) { - TweakingRegistry.addToolTipOnly(Item.paper.itemID, -1, TweakingAction.ADDED, "Check recipe to ensure 3x output"); + TweakingRegistry.addTweakedTooltip(Item.paper.itemID, -1, TweakingAction.ADDED, "Check recipe to ensure 3x output"); GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed}); TETweaks.addRecipes(); GameRegistry.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"#", "#", "#", '#', Item.reed}); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java index ceb3ba0..efc0783 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java @@ -7,9 +7,11 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.config.ConfigurationHandler; import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import tppitweaks.recipetweaks.RecipeRemoval; import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.Loader; @@ -21,7 +23,7 @@ public class IC2Tweaks public static void init() { if (ConfigurationHandler.removeStupidEnergyCrystalRecipe) - TweakingRegistry.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)ic2.core.Ic2Items.energyCrystal).itemID, -1, TweakingAction.REMOVED, "Recipe from dartcraft because", "it is imbalanced with vanilla IC2"); TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.iridiumDrill).itemID, -1); TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.mvTransformer).itemID, 4); @@ -30,6 +32,7 @@ public static void init() TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.personalSafe).itemID, 0); TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.nanoHelmet).itemID, -1); TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.electricJetpack).itemID, -1); + TweakingRegistry.markItemForRecipeRemoval(((ItemStack)Ic2Items.carbonFiber).itemID, -1); } @RecipeAddition(requiredModids="IC2", time=EventTime.INIT) @@ -76,5 +79,6 @@ public static void doPostLoadRecipeAdditions() GameRegistry.addRecipe(new ShapedOreRecipe(Ic2Items.personalSafe, new Object[] { "c", "M", "C", Character.valueOf('c'), Ic2Items.recipeObjectCircuit, Character.valueOf('C'), Block.chest, Character.valueOf('M'), Ic2Items.machine })); GameRegistry.addRecipe(new ShapedOreRecipe(Ic2Items.nanoHelmet, new Object[] { "CcC", "CGC", Character.valueOf('C'), Ic2Items.carbonPlate, Character.valueOf('c'), StackUtil.copyWithWildCard(Ic2Items.energyCrystal), Character.valueOf('G'), StackUtil.copyWithWildCard(Ic2Items.nightvisionGoggles) })); GameRegistry.addRecipe(new ShapedOreRecipe(Ic2Items.electricJetpack, new Object[] { "ICI", "IBI", "G G", Character.valueOf('I'), Ic2Items.casingiron, Character.valueOf('C'), Ic2Items.recipeObjectAdvCircuit, Character.valueOf('B'), Ic2Items.batBox, Character.valueOf('G'), Item.glowstone })); + GameRegistry.addRecipe(new ShapelessOreRecipe(Ic2Items.carbonFiber, "dustCoal", "dustCoal", "dustCoal", "dustCoal")); } } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java index 8ba2057..58604e0 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndIC2Tweaks.java @@ -2,12 +2,16 @@ import net.minecraft.item.ItemStack; import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; public class MagicropsAndIC2Tweaks { @RecipeAddition(requiredModids={"magicalcrops", "IC2"}) public static void addRecipes() { + ItemStack macerator = ic2.core.Ic2Items.macerator; + TweakingRegistry.addTweakedTooltip(macerator.itemID, macerator.getItemDamage(), TweakingAction.ADDED, "Recipe for Essence Ore and", "Nether Essence Ore"); ic2.core.block.machine.tileentity.TileEntityMacerator.addRecipe("oreMCropsEssence", 1, new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0)); ic2.core.block.machine.tileentity.TileEntityMacerator.addRecipe("oreMCropsNetherEssence", 1, new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 12, 0)); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java index 6f516b9..f0707f3 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MagicropsAndTETweaks.java @@ -3,12 +3,16 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import tppitweaks.recipetweaks.RecipeAddition; +import tppitweaks.recipetweaks.TweakingRegistry; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; public class MagicropsAndTETweaks { @RecipeAddition(requiredModids={"magicalcrops", "ThermalExpansion"}) public static void addRecipes() { + ItemStack pulv = thermalexpansion.block.machine.BlockMachine.pulverizer; + TweakingRegistry.addTweakedTooltip(pulv.itemID, pulv.getItemDamage(), TweakingAction.ADDED, "Recipes for Essence Ore and", "Nether Essence Ore"); thermalexpansion.util.crafting.PulverizerManager.addRecipe(2400, OreDictionary.getOres("oreMCropsEssence").get(0), new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 8, 0), new ItemStack(magicalcrops.mod_mCrops.CropEssence, 1, 0), 5); thermalexpansion.util.crafting.PulverizerManager.addRecipe(2400, OreDictionary.getOres("oreMCropsNetherEssence").get(0), new ItemStack(magicalcrops.mod_mCrops.MagicEssence, 12, 0), new ItemStack(magicalcrops.mod_mCrops.CropEssence, 1, 0), 10); } diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java index 0864148..4362c1c 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/RailcraftTweaks.java @@ -6,6 +6,8 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.recipetweaks.RecipeAddition; import tppitweaks.recipetweaks.RecipeAddition.EventTime; +import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; +import tppitweaks.recipetweaks.TweakingRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class RailcraftTweaks @@ -22,5 +24,9 @@ public static void registerOres() GameRegistry.addRecipe(new ShapelessOreRecipe(plateIron, "plateIron")); GameRegistry.addRecipe(new ShapelessOreRecipe(plateSteel, "plateSteel")); GameRegistry.addRecipe(new ShapelessOreRecipe(plateTin, "plateTin")); + + TweakingRegistry.addTweakedTooltip(plateIron.itemID, plateIron.getItemDamage(), TweakingAction.ADDED, "Shapeless recipe to swap", "plate types"); + TweakingRegistry.addTweakedTooltip(plateIron.itemID, plateSteel.getItemDamage(), TweakingAction.ADDED, "Shapeless recipe to swap", "plate types"); + TweakingRegistry.addTweakedTooltip(plateIron.itemID, plateTin.getItemDamage(), TweakingAction.ADDED, "Shapeless recipe to swap", "plate types"); } } From 36a4b4ae2cc9fdde5c1ef1e0cb0b7e77cf306100 Mon Sep 17 00:00:00 2001 From: wha-ha-ha Date: Fri, 11 Apr 2014 00:44:23 -0400 Subject: [PATCH 26/35] Universal cable disablement. --- src/main/java/tppitweaks/config/ConfigurationHandler.java | 2 ++ .../tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 815a079..349c2e8 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -69,6 +69,7 @@ public class ConfigurationHandler public static boolean disableCardboardBox; public static boolean disableMiner; public static boolean nerfMiner; + public static boolean disableUniversalCables; public static boolean harderLillipadRecipe; @@ -166,6 +167,7 @@ public static void init(File file) disableCardboardBox = config.get("Mekanism Tweaks", "disableCardboardBox", false, "Remove the recipe for the cardboard box (it can move ANY tile entity including nodes and spanwers)").getBoolean(false); disableMiner = config.get("Mekanism Tweaks", "disableDigitalMiner", false, "Remove the recipe for the digital miner (not really any reason to do this now but I'm not deleting code)").getBoolean(false); nerfMiner = config.get("Mekanism Tweaks", "nerfDigitalMiner", true, "Make the recipe for the digital miner a bit...ok a lot harder").getBoolean(true); + disableUniversalCables = config.get("Mekanism Tweaks", "disableUniversalCables", true, "Remove the recipe for universal cables.").getBoolean(true); autoEnableTT = config.get("Mod Loading Tweaks", "autoEnableTT", true, "Allow this mod to disable and enable Thaumic Tinkerer automatically").getBoolean(true); diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java index b3f5db8..aaf80dc 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/MekanismTweaks.java @@ -28,6 +28,13 @@ public static void init() { TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.cardboardBoxID, -1); } + if (ConfigurationHandler.disableUniversalCables) + { + for(int i = 0; i < 4; i++) { + TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.PartTransmitter.itemID, i, TweakingAction.REMOVED, "Crashes"); + } + } + if (ConfigurationHandler.disableMiner || ConfigurationHandler.nerfMiner) { TweakingRegistry.markItemForRecipeRemoval(mekanism.common.Mekanism.machineBlockID, 4, TweakingAction.CHANGED, "Changed to balance better", "with other quarry-like blocks"); From fedee60bb8cd73548809797f446335263993bdb2 Mon Sep 17 00:00:00 2001 From: wha-ha-ha Date: Tue, 15 Apr 2014 20:53:38 -0400 Subject: [PATCH 27/35] Universal Cable default removal reverted - config kept just in case. --- src/main/java/tppitweaks/config/ConfigurationHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 349c2e8..ccc0a37 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -167,7 +167,7 @@ public static void init(File file) disableCardboardBox = config.get("Mekanism Tweaks", "disableCardboardBox", false, "Remove the recipe for the cardboard box (it can move ANY tile entity including nodes and spanwers)").getBoolean(false); disableMiner = config.get("Mekanism Tweaks", "disableDigitalMiner", false, "Remove the recipe for the digital miner (not really any reason to do this now but I'm not deleting code)").getBoolean(false); nerfMiner = config.get("Mekanism Tweaks", "nerfDigitalMiner", true, "Make the recipe for the digital miner a bit...ok a lot harder").getBoolean(true); - disableUniversalCables = config.get("Mekanism Tweaks", "disableUniversalCables", true, "Remove the recipe for universal cables.").getBoolean(true); + disableUniversalCables = config.get("Mekanism Tweaks", "disableUniversalCables", false, "Remove the recipe for universal cables.").getBoolean(false); autoEnableTT = config.get("Mod Loading Tweaks", "autoEnableTT", true, "Allow this mod to disable and enable Thaumic Tinkerer automatically").getBoolean(true); From 00821e18ab4fe4f40b3a61d6bf6ccd005073ef50 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 18 Apr 2014 01:31:32 -0400 Subject: [PATCH 28/35] Fix JABBA config....on the right branch --- src/main/java/tppitweaks/config/ConfigurationHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/config/ConfigurationHandler.java b/src/main/java/tppitweaks/config/ConfigurationHandler.java index 815a079..e4fc17b 100644 --- a/src/main/java/tppitweaks/config/ConfigurationHandler.java +++ b/src/main/java/tppitweaks/config/ConfigurationHandler.java @@ -133,7 +133,7 @@ public static void init(File file) removeStupidEnergyCrystalRecipe = config.get("Other Mod Tweaks", "removeDartCraftEnergyCrystalRecipe", true, "Remove DartCraft's IC2 energy crystal recipe.").getBoolean(true); disableForceShears = config.get("Other Mod Tweaks", "disableForceShears", true, "Remove the force shears recipe because they were crashing servers rarely, but in a serious way. Disable this at your own risk.").getBoolean(true); disableAGAutoOutputter = config.get("Other Mod Tweaks", "disableAGAutoOutputter", true, "Remove the recipe for the Advanced Genetics auto output upgrade, because crashes.").getBoolean(true); - tweakJABBA = config.get("Other Mod Tweaks", "tweakJABBA", "Alter the JABBA barrel recipe to be a little more complicated, leaving FZ barrels as a \"low-tech\" option").getBoolean(true); + tweakJABBA = config.get("Other Mod Tweaks", "tweakJABBA", true, "Alter the JABBA barrel recipe to be a little more complicated, leaving FZ barrels as a \"low-tech\" option").getBoolean(true); buffUnifierRecipe = config.get("Other Mod Tweaks", "buffUnifierRecipe", true, "Make the unifier cheaper.").getBoolean(true); makeEIOHardModeEasier = config.get("Other Mod Tweaks", "makeEnderIOHardModeEasier", true, "Give some EnderIO recipes a buff as they are way too diffucult. Currently affects: basic capacitor, reservoir").getBoolean(true); unregisterFusedQuartz = config.get("Other Mod Tweaks", "unregisterFusedQuartz", true, "Having fused quartz be registered under hardened glass doesn't make much sense. This fixes that.").getBoolean(true); From 41c1942bde4b479aa71749c5c525d1a33c85520f Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Mon, 21 Apr 2014 20:39:38 -0400 Subject: [PATCH 29/35] Add reverse compressed redstone recipe and register it in oredict --- src/main/java/tppitweaks/block/ModBlocks.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/tppitweaks/block/ModBlocks.java b/src/main/java/tppitweaks/block/ModBlocks.java index 920dd67..2ad29e5 100644 --- a/src/main/java/tppitweaks/block/ModBlocks.java +++ b/src/main/java/tppitweaks/block/ModBlocks.java @@ -4,6 +4,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; import tppitweaks.config.ConfigurationHandler; import cpw.mods.fml.common.registry.GameRegistry; @@ -17,6 +18,9 @@ public static void initBlocks() { } public static void registerRecipes() { + + OreDictionary.registerOre("blockCompressedRedstone", tppiBlock); + if(OreDictionary.getOres("blockRedstone").isEmpty()) { GameRegistry.addShapedRecipe(new ItemStack(tppiBlock), @@ -40,6 +44,8 @@ public static void registerRecipes() { })); } + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.blockRedstone, 9), "blockCompressedRedstone")); } } From 193cb5a0befe8395dd30cdd9947113c2a0a60dae Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Tue, 22 Apr 2014 18:47:54 -0400 Subject: [PATCH 30/35] Books should auto-update regardless now --- src/main/java/tppitweaks/item/TPPIBook.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/tppitweaks/item/TPPIBook.java b/src/main/java/tppitweaks/item/TPPIBook.java index fe841c9..fb47b73 100644 --- a/src/main/java/tppitweaks/item/TPPIBook.java +++ b/src/main/java/tppitweaks/item/TPPIBook.java @@ -17,6 +17,7 @@ import tppitweaks.client.gui.GuiHelper; import tppitweaks.config.ConfigurationHandler; import tppitweaks.util.FileLoader; +import tppitweaks.util.TxtParser; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; @@ -85,7 +86,7 @@ public ItemStack addTextToBook(ItemStack book, int damage) switch (damage) { - case 0: + case 0: book.setTagInfo("title", new NBTTagString("title", ConfigurationHandler.bookTitle)); nbttagcompound = book.getTagCompound(); @@ -126,11 +127,13 @@ public ItemStack addTextToBook(ItemStack book, int damage) public ItemStack getGuide() { + ConfigurationHandler.bookText = TxtParser.parseFileMain(FileLoader.getGuideText()); return addTextToBook(new ItemStack(ModItems.tppiBook), 0); } public ItemStack getChangelog() { + ConfigurationHandler.changelog = TxtParser.parseFileMain(FileLoader.getChangelogText()); return addTextToBook(new ItemStack(ModItems.tppiBook, 1, 1), 1); } From 195f42e5a49685cbf71c5c520d2f8995d0bc7916 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Tue, 22 Apr 2014 20:11:01 -0400 Subject: [PATCH 31/35] Version bump --- build.properties | 2 +- src/main/java/tppitweaks/TPPITweaks.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index cfc303d..4c972d0 100644 --- a/build.properties +++ b/build.properties @@ -1,3 +1,3 @@ minecraft_version=1.6.4 forge_version=9.11.1.964 -mod_version=1.0.0 \ No newline at end of file +mod_version=1.1.0 \ No newline at end of file diff --git a/src/main/java/tppitweaks/TPPITweaks.java b/src/main/java/tppitweaks/TPPITweaks.java index 82f7be6..765cac9 100644 --- a/src/main/java/tppitweaks/TPPITweaks.java +++ b/src/main/java/tppitweaks/TPPITweaks.java @@ -37,7 +37,7 @@ @NetworkMod(serverSideRequired = true, clientSideRequired = true, channels = { Reference.CHANNEL }, packetHandler = PacketHandler.class) public class TPPITweaks { - public static final String VERSION = "1.0.0"; + public static final String VERSION = "1.1.0"; @Instance("TPPITweaks") public static TPPITweaks instance; From 5526087415985b6beed6e61e7bf87d485052b5f3 Mon Sep 17 00:00:00 2001 From: Tristen Allen Date: Tue, 22 Apr 2014 21:13:26 -0400 Subject: [PATCH 32/35] Fix BigReactors recipes --- .../recipetweaks/modTweaks/BigReactorsTweaks.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java index 35a5cc8..f50ea52 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/BigReactorsTweaks.java @@ -48,25 +48,25 @@ public static void addRecipes() } if (ConfigurationHandler.twoReactorGlass) { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 0, 2), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 2), "gCg", 'g', "glassHardened", 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockReactorPart, 1, 0))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 0, 2), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 2), "gCg", 'g', "glassReinforced", 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockReactorPart, 1, 0))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 1, 2), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 2, 1), "gCg", 'g', "glassHardened", 'C', new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockTurbinePart, 1, 0))); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 1, 2), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(erogenousbeef.bigreactors.common.BigReactors.blockMultiblockGlass, 2, 1), "gCg", 'g', "glassReinforced", From 89b2905d09a20e31ea7ee81b52b787f5ad989bf2 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Tue, 22 Apr 2014 22:48:46 -0400 Subject: [PATCH 33/35] - Add some safety to the recipe tweaking system that was lost in a deleted branch (oops) - Fix ExU unstable nuggets possibly --- .../tppitweaks/recipetweaks/RecipeTweaks.java | 20 +++++++++--- .../recipetweaks/modTweaks/ExUTweaks.java | 32 +++++++++++++------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java index 458d696..f406e9f 100644 --- a/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/RecipeTweaks.java @@ -80,8 +80,7 @@ public static void removeRecipes() for (ClassInfo c : classes) { - Class clazz = c.load(); - for (Method m : clazz.getDeclaredMethods()) + for (Method m : loadClassSafe(c)) { RecipeRemoval r = m.getAnnotation(RecipeRemoval.class); System.out.println(c.getName() + " : " + m.getName() + " : " + Arrays.deepToString(m.getDeclaredAnnotations())); @@ -111,8 +110,7 @@ public static void addRecipes(EventTime time) for (ClassInfo c : classes) { - Class clazz = c.load(); - for (Method m : clazz.getDeclaredMethods()) + for (Method m : loadClassSafe(c)) { RecipeAddition r = m.getAnnotation(RecipeAddition.class); if (r != null && allModsLoaded(r.requiredModids()) && r.time() == time) @@ -130,6 +128,20 @@ public static void addRecipes(EventTime time) } } + private static Method[] loadClassSafe(ClassInfo c) + { + try + { + Class clazz = c.load(); + return clazz.getDeclaredMethods(); + } + catch (Throwable t) + { + TPPITweaks.logger.info(String.format("Class %s threw an error, skipping...", c.getName())); + return new Method[]{}; + } + } + public static void doRemainingTweaks(EventTime time) { switch(time) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index a5b459a..d918c2d 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -19,6 +19,7 @@ import tppitweaks.recipetweaks.TweakingRegistry.TweakingAction; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; +import extrautils.ExtraUtils; public class ExUTweaks { @@ -127,7 +128,20 @@ public static void addRecipes() { 'F', Block.furnaceIdle )); } - + + try + { + Field f = OreDictionary.class.getDeclaredField("oreIDs"); + f.setAccessible(true); + HashMap temp = (HashMap) f.get(null); + temp.remove("nuggetUnstable"); + f.set(null, temp); + } + catch (Throwable t) + { + t.printStackTrace(); + } + if (ConfigurationHandler.fixExURecipes) { try @@ -136,11 +150,11 @@ public static void addRecipes() { TPPITweaks.logger.info("Fixing ExtraUtils OreDict registrations by hacky reflection"); Field f = OreDictionary.class.getDeclaredField("oreIDs"); f.setAccessible(true); - HashMap temp = (HashMap) f.get(null); - temp.remove("blockUnstable"); - temp.remove("burntquartz"); - temp.remove("icestone"); - f.set(null, temp); + HashMap temp1 = (HashMap) f.get(null); + temp1.remove("blockUnstable"); + temp1.remove("burntquartz"); + temp1.remove("icestone"); + f.set(null, temp1); } catch (Throwable t) { @@ -150,10 +164,10 @@ public static void addRecipes() { OreDictionary.registerOre("blockUnstable", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5)); OreDictionary.registerOre("burntquartz", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 2)); OreDictionary.registerOre("icestone", new ItemStack(extrautils.ExtraUtils.decorative1, 1, 3)); - - if (Loader.isModLoaded("gregtech_addon")) - TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); } + + if (Loader.isModLoaded("gregtech_addon")) + TPPITweaks.logger.info("Stahp, greg, I know. Blame Tema."); } @RecipeAddition(requiredModids="ExtraUtilities", time=EventTime.PLAYER_JOIN) From 95f83bc3058cc64612dad0f128d63dfbbb32cea2 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Tue, 22 Apr 2014 23:00:35 -0400 Subject: [PATCH 34/35] Trying again --- .../java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java index d918c2d..f924af0 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/ExUTweaks.java @@ -6,6 +6,7 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import tppitweaks.TPPITweaks; @@ -173,6 +174,11 @@ public static void addRecipes() { @RecipeAddition(requiredModids="ExtraUtilities", time=EventTime.PLAYER_JOIN) public static void doPostLoadRecipeAdditions() { + ItemStack stableIngot = new ItemStack(ExtraUtils.unstableIngot); + stableIngot.stackTagCompound = new NBTTagCompound(); + stableIngot.stackTagCompound.setBoolean("stable", true); + GameRegistry.addRecipe(new ItemStack(extrautils.ExtraUtils.decorative1, 1, 5), "iii", "iii", "iii", 'i', extrautils.ExtraUtils.unstableIngot); + GameRegistry.addRecipe(stableIngot, "nnn", "nnn", "nnn", 'n', new ItemStack(ExtraUtils.unstableIngot, 1, 1)); } } From 29b281c43260c7e553bb6e4027babbff6b8f8a1e Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Wed, 23 Apr 2014 18:24:56 -0400 Subject: [PATCH 35/35] Quick fix for openblocks crash --- .../modTweaks/OpenBlocksTweaks.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java index 2b11572..3d0880e 100644 --- a/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java +++ b/src/main/java/tppitweaks/recipetweaks/modTweaks/OpenBlocksTweaks.java @@ -18,8 +18,11 @@ public static void init() { if (ConfigurationHandler.eloraamBreakersAndDeployers) { - TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1, TweakingAction.CHANGED, "Recipe changed to bring back", "RP2-like recipes"); - TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1, TweakingAction.CHANGED, "Recipe changed to bring back", "RP2-like recipes"); + if (openblocks.OpenBlocks.Blocks.blockBreaker != null) + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockBreaker).blockID, -1, TweakingAction.CHANGED, "Recipe changed to bring back", "RP2-like recipes"); + + if (openblocks.OpenBlocks.Blocks.blockPlacer != null) + TweakingRegistry.markItemForRecipeRemoval(((Block) openblocks.OpenBlocks.Blocks.blockPlacer).blockID, -1, TweakingAction.CHANGED, "Recipe changed to bring back", "RP2-like recipes"); } } @@ -28,10 +31,13 @@ public static void addRecipes() { if (ConfigurationHandler.eloraamBreakersAndDeployers) { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, - 'P', Block.pistonBase, 'R', Item.redstone })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', - Block.pistonBase, 'R', Item.redstone })); + if (openblocks.OpenBlocks.Blocks.blockBreaker != null) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockBreaker), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Item.pickaxeIron, + 'P', Block.pistonBase, 'R', Item.redstone })); + + if (openblocks.OpenBlocks.Blocks.blockPlacer != null) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack((openblocks.OpenBlocks.Blocks.blockPlacer), 1), new Object[] { "CAC", "CPC", "CRC", 'C', "cobblestone", 'A', Block.chest, 'P', + Block.pistonBase, 'R', Item.redstone })); } } }