Add config to disable railcraft steel recipe.
This commit is contained in:
commit
9e02f1ff35
3 changed files with 29 additions and 0 deletions
|
@ -175,6 +175,8 @@ public class Core {
|
|||
proxy.postInit(event);
|
||||
logHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
|
||||
|
||||
ModRecipes.postInit();
|
||||
|
||||
// RecipeHandler.scanForDupeRecipes();
|
||||
|
||||
// RecipeConfigManager.save();
|
||||
|
|
|
@ -22,6 +22,7 @@ public class ConfigTechReborn {
|
|||
public static boolean UninsulatedElectocutionParticle;
|
||||
public static boolean UninsulatedElectocutionDamage;
|
||||
public static boolean ScrapboxDispenser;
|
||||
public static boolean disableRailcraftSteelNuggetRecipe;
|
||||
// Power
|
||||
public static int LightningRodChance;
|
||||
public static int ThermalGeneratorOutput;
|
||||
|
@ -412,6 +413,9 @@ public class ConfigTechReborn {
|
|||
REMOVE_DUPLICATES = config
|
||||
.get(CATEGORY_CRAFTING, "Remove Duplicates when IC2 is installed", false, "This atempts to fully intergrate TR with ic2 recipes (Beta)")
|
||||
.getBoolean(false);
|
||||
|
||||
disableRailcraftSteelNuggetRecipe = config.get(CATEGORY_CRAFTING, "Disable Railcraft's Steel nugget recipe", false, "When true TechReborn will remove Railcrafts Iron Nugget to steel nuggert recipe.").getBoolean(false);
|
||||
|
||||
// Uu
|
||||
HideUuRecipes = config.get(CATEGORY_UU, "Hide UU Recipes", true, "Hide UU Recipes from JEI/NEI")
|
||||
.getBoolean(true);
|
||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.init;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.UniversalBucket;
|
||||
|
@ -10,6 +11,7 @@ import net.minecraftforge.fml.common.Loader;
|
|||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.CraftingHelper;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.Core;
|
||||
|
@ -23,6 +25,9 @@ import techreborn.config.ConfigTechReborn;
|
|||
import techreborn.init.recipes.*;
|
||||
import techreborn.items.*;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import static techreborn.utils.OreDictUtils.getDictData;
|
||||
import static techreborn.utils.OreDictUtils.getDictOreOrEmpty;
|
||||
import static techreborn.utils.OreDictUtils.isDictPrefixed;
|
||||
|
@ -63,6 +68,24 @@ public class ModRecipes {
|
|||
addCompressorRecipes();
|
||||
}
|
||||
|
||||
public static void postInit(){
|
||||
if(ConfigTechReborn.disableRailcraftSteelNuggetRecipe){
|
||||
Iterator iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator();
|
||||
Map.Entry entry;
|
||||
while (iterator.hasNext()) {
|
||||
entry = (Map.Entry) iterator.next();
|
||||
if (entry.getValue() instanceof ItemStack && entry.getKey() instanceof ItemStack) {
|
||||
ItemStack input = (ItemStack) entry.getKey();
|
||||
ItemStack output = (ItemStack) entry.getValue();
|
||||
if(ItemUtils.isInputEqual("nuggetSteel", output, true , true, false) && ItemUtils.isInputEqual("nuggetIron", input, true , true, false)){
|
||||
Core.logHelper.info("Removing a steelnugget smelting recipe");
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void addCompressorRecipes() {
|
||||
RecipeHandler.addRecipe(new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"),
|
||||
ItemPlates.getPlateByName("advanced_alloy"), 400, 20));
|
||||
|
|
Loading…
Reference in a new issue