Add config to disable railcraft steel recipe.
This commit is contained in:
commit
9e02f1ff35
3 changed files with 29 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue