Search in sources :

Example 1 with RecipeBlastFurnace

use of de.canitzp.metalworks.machine.blastfurnace.RecipeBlastFurnace in project Metalworks by canitzp.

the class Metalworks method postInit.

@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
    SimpleSteelRecipeHandler.addBlastFurnaceRecipe(new RecipeBlastFurnace(new OreDictStack("ingotIron").setStacksize(2), new OreDictStack(Items.COAL).setStacksize(3), OreDictStack.EMPTY, new ItemStack(Registry.steelIngot), ItemStack.EMPTY, 0, 400, -1));
    SimpleSteelRecipeHandler.addBlastFurnaceRecipe(new RecipeBlastFurnace(new OreDictStack("ingotIron").setStacksize(3), new OreDictStack("gemDiamond"), OreDictStack.EMPTY, new ItemStack(Registry.metalShielding, 4), new ItemStack(Items.IRON_NUGGET), 25, 250, -1));
    // Generic Crusher
    for (String name : OreDictionary.getOreNames()) {
        if (name.startsWith("ore")) {
            String dustName = name.replaceFirst("ore", "dust");
            NonNullList<ItemStack> oreEntries = OreDictionary.getOres(dustName);
            if (!oreEntries.isEmpty()) {
                ItemStack dust = oreEntries.get(0).copy();
                dust.setCount(2);
                MACHINE_RECIPE_REGISTRY.register(new RecipeCrusher(name + "_" + dustName, new OreDictStack(name), dust, ItemStack.EMPTY, 0, 200, 0));
            }
        } else if (name.startsWith("ingot")) {
            String dustName = name.replaceFirst("ingot", "dust");
            NonNullList<ItemStack> oreEntries = OreDictionary.getOres(dustName);
            if (!oreEntries.isEmpty()) {
                ItemStack dust = oreEntries.get(0).copy();
                dust.setCount(1);
                MACHINE_RECIPE_REGISTRY.register(new RecipeCrusher(name + "_" + dustName, new OreDictStack(name), dust, ItemStack.EMPTY, 0, 150, 0));
            }
        }
    }
}
Also used : NonNullList(net.minecraft.util.NonNullList) RecipeBlastFurnace(de.canitzp.metalworks.machine.blastfurnace.RecipeBlastFurnace) ItemStack(net.minecraft.item.ItemStack) RecipeCrusher(de.canitzp.metalworks.machine.crusher.RecipeCrusher) OreDictStack(de.canitzp.metalworks.recipe.OreDictStack)

Aggregations

RecipeBlastFurnace (de.canitzp.metalworks.machine.blastfurnace.RecipeBlastFurnace)1 RecipeCrusher (de.canitzp.metalworks.machine.crusher.RecipeCrusher)1 OreDictStack (de.canitzp.metalworks.recipe.OreDictStack)1 ItemStack (net.minecraft.item.ItemStack)1 NonNullList (net.minecraft.util.NonNullList)1