Search in sources :

Example 1 with RecipeCrusher

use of de.canitzp.metalworks.machine.crusher.RecipeCrusher 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)

Example 2 with RecipeCrusher

use of de.canitzp.metalworks.machine.crusher.RecipeCrusher in project Metalworks by canitzp.

the class Registry method registerMachineRecipes.

@SubscribeEvent
public static void registerMachineRecipes(RegistryEvent.Register<IMachineRecipe> event) {
    IForgeRegistry<IMachineRecipe> reg = event.getRegistry();
    // Duster
    reg.register(new RecipeDuster("quartz_sand_dust", new OreDictStack("gemQuartz"), new OreDictStack("sand"), new ItemStack(quartzSandDust, 2), 0, 0));
    // Crusher
    reg.register(new RecipeCrusher("wool_string", new OreDictStack(new ItemStack(Blocks.WOOL, 1, OreDictionary.WILDCARD_VALUE)), new ItemStack(Items.STRING, 2), new ItemStack(Items.STRING), 50, 100, 50));
}
Also used : ItemStack(net.minecraft.item.ItemStack) RecipeCrusher(de.canitzp.metalworks.machine.crusher.RecipeCrusher) IMachineRecipe(de.canitzp.metalworks.machine.IMachineRecipe) RecipeDuster(de.canitzp.metalworks.machine.duster.RecipeDuster) OreDictStack(de.canitzp.metalworks.recipe.OreDictStack) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

RecipeCrusher (de.canitzp.metalworks.machine.crusher.RecipeCrusher)2 OreDictStack (de.canitzp.metalworks.recipe.OreDictStack)2 ItemStack (net.minecraft.item.ItemStack)2 IMachineRecipe (de.canitzp.metalworks.machine.IMachineRecipe)1 RecipeBlastFurnace (de.canitzp.metalworks.machine.blastfurnace.RecipeBlastFurnace)1 RecipeDuster (de.canitzp.metalworks.machine.duster.RecipeDuster)1 NonNullList (net.minecraft.util.NonNullList)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1