Search in sources :

Example 86 with ShapedOreRecipe

use of net.minecraftforge.oredict.ShapedOreRecipe in project ICBM-Classic by BuiltBrokenModding.

the class BlockConcrete method genRecipes.

@Override
public void genRecipes(List<IRecipe> recipes) {
    recipes.add(new ShapedOreRecipe(new ItemStack(this, 8, 0), "SGS", "GWG", "SGS", 'G', Blocks.gravel, 'S', Blocks.sand, 'W', Items.water_bucket));
    recipes.add(new ShapedOreRecipe(new ItemStack(this, 8, 1), "COC", "OCO", "COC", 'C', new ItemStack(this, 1, 0), 'O', Blocks.obsidian));
    recipes.add(new ShapedOreRecipe(new ItemStack(this, 8, 2), "COC", "OCO", "COC", 'C', new ItemStack(this, 1, 1), 'O', "ingotSteel"));
}
Also used : ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe) ItemStack(net.minecraft.item.ItemStack)

Example 87 with ShapedOreRecipe

use of net.minecraftforge.oredict.ShapedOreRecipe in project ConvenientAdditions by Necr0.

the class ModRecipes method initBlocks.

private static void initBlocks() {
    if (ModConfigMisc.platform) {
        for (EnumDyeColor c : EnumDyeColor.values()) {
            String dye = "dye" + c.getUnlocalizedName().substring(0, 1).toUpperCase() + c.getUnlocalizedName().substring(1);
            String pane = "paneGlass" + c.getUnlocalizedName().substring(0, 1).toUpperCase() + c.getUnlocalizedName().substring(1);
            String block = "blockGlass" + c.getUnlocalizedName().substring(0, 1).toUpperCase() + c.getUnlocalizedName().substring(1);
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.platform, 4, c.getMetadata()), "p p", " d ", "p p", 'd', dye, 'p', pane));
            ItemStack w = new ItemStack(ModBlocks.platform, 1, OreDictionary.WILDCARD_VALUE);
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.platform, 4, c.getMetadata()), w, w, w, w, dye));
            GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.semiSolidBlock, 4, c.getMetadata()), "b b", " d ", "b b", 'd', dye, 'b', block));
            w = new ItemStack(ModBlocks.semiSolidBlock, 1, OreDictionary.WILDCARD_VALUE);
            GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.semiSolidBlock, 4, c.getMetadata()), w, w, w, w, dye));
        }
    }
    if (ModConfigMisc.powderKeg)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.powderKegBlock), "psp", "pgp", "psp", 'p', "plankWood", 's', "slabWood", 'g', "gunpowder"));
    if (ModConfigMisc.seedBox_recipe)
        GameRegistry.addRecipe(new ShapedOreRecipe(ModBlocks.seedBoxBlock, "tpt", "php", "tpt", 'h', Blocks.HOPPER, 'p', "plankWood", 't', "ingotIron"));
    if (ModConfigMisc.displayCase)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.displayCase, 2), "ppp", "p p", "sss", 's', "slabWood", 'p', "paneGlassColorless"));
    if (ModConfigBuildingBlocks.ironGolemBlock)
        GameRegistry.addRecipe(new ShapedNBTOreRecipe(new ItemStack(ModBlocks.ironGolemBlock, 32), "iii", "isi", "iii", 'i', "blockIron", 's', ModItems.itemSoulGem.setEntityId(new ItemStack(ModItems.itemSoulGem), "minecraft:villager_golem")));
    if (ModConfigMisc.enderProofBlock)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.enderProofBlock, 6), "oio", "iwi", "oio", 'o', "obsidian", 'i', Blocks.IRON_BARS, 'w', Items.WATER_BUCKET));
    if (ModConfigMisc.enderProofGlass)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.enderProofGlass, 6), "gig", "iwi", "gig", 'g', "blockGlass", 'i', Blocks.IRON_BARS, 'w', Items.WATER_BUCKET));
    if (ModConfigMisc.workStation)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.workStation), "sss", "pwp", "pcp", 's', "cobblestone", 'p', "plankWood", 'c', "chestWood", 'w', "workbench"));
    if (ModConfigMisc.punjiSticks)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.punjiSticks), "ss", "cc", 's', ModItems.itemSpikes, 'c', new ItemStack(Blocks.STONE_SLAB)));
    if (ModConfigMisc.storageCrate)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.storageCrate), "lll", "lcl", "lll", 'l', "logWood", 'c', "chestWood"));
    if (ModConfigBuildingBlocks.woodenTile)
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.woodenTile, 8), "sps", "ppp", "sps", 's', "stickWood", 'p', "plankWood"));
}
Also used : ShapedNBTOreRecipe(convenientadditions.api.recipe.ShapedNBTOreRecipe) ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe) ShapelessOreRecipe(net.minecraftforge.oredict.ShapelessOreRecipe) ItemStack(net.minecraft.item.ItemStack) EnumDyeColor(net.minecraft.item.EnumDyeColor)

Example 88 with ShapedOreRecipe

use of net.minecraftforge.oredict.ShapedOreRecipe in project ICBM-Classic by BuiltBrokenModding.

the class ExEMP method init.

@Override
public void init() {
    boolean registered = false;
    //IC2:itemAdvBat
    Object[] items = { "battery", InventoryUtility.getItem("IC2:itemBatRE"), "capacitorBasic" };
    for (Object object : items) {
        if (object != null && (!(object instanceof String) || OreDictionary.doesOreNameExist((String) object))) {
            RecipeUtility.addRecipe(new ShapedOreRecipe(Explosives.EMP.getItemStack(), "RBR", "BTB", "RBR", 'T', Explosives.REPLUSIVE.getItemStack(), 'R', Blocks.redstone_block, 'B', object), this.getUnlocalizedName(), ICBMClassic.INSTANCE.getConfig(), true);
            registered = true;
        }
    }
    if (!registered) {
        RecipeUtility.addRecipe(new ShapedOreRecipe(Explosives.EMP.getItemStack(), "RBR", "BTB", "RBR", 'T', Explosives.REPLUSIVE.getItemStack(), 'R', Blocks.redstone_block, 'B', Items.emerald), this.getUnlocalizedName(), ICBMClassic.INSTANCE.getConfig(), true);
    }
}
Also used : ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe)

Example 89 with ShapedOreRecipe

use of net.minecraftforge.oredict.ShapedOreRecipe in project Galacticraft by micdoodle8.

the class ShapedRecipeHandler method loadUsageRecipes.

@Override
public void loadUsageRecipes(ItemStack ingredient) {
    for (IRecipe irecipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
        CachedShapedRecipe recipe = null;
        if (irecipe instanceof ShapedRecipes) {
            recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
        } else if (irecipe instanceof ShapedOreRecipe) {
            recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
        }
        if (recipe == null || !recipe.contains(recipe.ingredients, ingredient.getItem())) {
            continue;
        }
        recipe.computeVisuals();
        if (recipe.contains(recipe.ingredients, ingredient)) {
            recipe.setIngredientPermutation(recipe.ingredients, ingredient);
            arecipes.add(recipe);
        }
    }
}
Also used : ShapedRecipes(net.minecraft.item.crafting.ShapedRecipes) IRecipe(net.minecraft.item.crafting.IRecipe) ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe) ArrayList(java.util.ArrayList) List(java.util.List)

Example 90 with ShapedOreRecipe

use of net.minecraftforge.oredict.ShapedOreRecipe in project Galacticraft by micdoodle8.

the class ShapedRecipeHandler method loadCraftingRecipes.

@Override
public void loadCraftingRecipes(String outputId, Object... results) {
    if (outputId.equals("crafting") && getClass() == ShapedRecipeHandler.class) {
        for (IRecipe irecipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
            CachedShapedRecipe recipe = null;
            if (irecipe instanceof ShapedRecipes) {
                recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
            } else if (irecipe instanceof ShapedOreRecipe) {
                recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
            }
            if (recipe == null) {
                continue;
            }
            recipe.computeVisuals();
            arecipes.add(recipe);
        }
    } else {
        super.loadCraftingRecipes(outputId, results);
    }
}
Also used : ShapedRecipes(net.minecraft.item.crafting.ShapedRecipes) IRecipe(net.minecraft.item.crafting.IRecipe) ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ShapedOreRecipe (net.minecraftforge.oredict.ShapedOreRecipe)132 ItemStack (net.minecraft.item.ItemStack)94 ShapelessOreRecipe (net.minecraftforge.oredict.ShapelessOreRecipe)35 IRecipe (net.minecraft.item.crafting.IRecipe)22 ResourceLocation (net.minecraft.util.ResourceLocation)19 ShapedRecipes (net.minecraft.item.crafting.ShapedRecipes)15 ArrayList (java.util.ArrayList)13 ShapelessRecipes (net.minecraft.item.crafting.ShapelessRecipes)10 List (java.util.List)7 Item (net.minecraft.item.Item)7 ShapedPrimer (net.minecraftforge.common.crafting.CraftingHelper.ShapedPrimer)5 Block (net.minecraft.block.Block)4 EnumDyeColor (net.minecraft.item.EnumDyeColor)4 Ingredient (net.minecraft.item.crafting.Ingredient)4 EnumGem (net.silentchaos512.gems.lib.EnumGem)4 PacketRegistry (pl.asie.charset.lib.network.PacketRegistry)4 JsonObject (com.google.gson.JsonObject)3 Pair (com.builtbroken.jlib.type.Pair)2 JsonArray (com.google.gson.JsonArray)2 JsonSyntaxException (com.google.gson.JsonSyntaxException)2