当前位置: 首页>>代码示例>>Java>>正文


Java ShapedOreRecipe类代码示例

本文整理汇总了Java中net.minecraftforge.oredict.ShapedOreRecipe的典型用法代码示例。如果您正苦于以下问题:Java ShapedOreRecipe类的具体用法?Java ShapedOreRecipe怎么用?Java ShapedOreRecipe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ShapedOreRecipe类属于net.minecraftforge.oredict包,在下文中一共展示了ShapedOreRecipe类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test_useUpItem

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
@Test
public void test_useUpItem()
{
    ShapedOreRecipe recipe = new DamageableShapedOreRecipe(new ResourceLocation("group"),
                                                           new int[] {60}, new ItemStack(Blocks.DIRT),
                                                           "A",
                                                           'A', new ItemStack(Items.WOODEN_SWORD));

    InventoryCrafting inv = new InventoryCrafting(new Container()
    {
        @Override
        public boolean canInteractWith(EntityPlayer playerIn)
        {
            return false;
        }
    }, 3, 3);

    inv.setInventorySlotContents(0, new ItemStack(Items.WOODEN_SWORD));
    assertTrue(recipe.matches(inv, null));

    NonNullList<ItemStack> remaining = recipe.getRemainingItems(inv);
    assertTrue(remaining.get(0).isEmpty());
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:24,代码来源:DamageableShapedOreRecipeTest.java

示例2: RecipeUnstableCrafting

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public RecipeUnstableCrafting(final ItemStack result, final Object... recipe) {
    super(result, recipe);
    this.checker = new ShapedOreRecipe(result, recipe);
    final Object[] input = super.getInput();
    final ArrayList<Object> ee3input = new ArrayList<Object>();
    for (final Object anInput : input) {
        boolean flag = true;
        if (anInput instanceof ArrayList) {
            final ArrayList<ItemStack> itemStacks = (ArrayList<ItemStack>)anInput;
            for (final ItemStack itemStack : itemStacks) {
                if (itemStack.getItem() == ExtraUtils.unstableIngot && itemStack.getItemDamage() == 2) {
                    itemStack.setTagCompound(RecipeUnstableCrafting.nbt);
                    ee3input.add(Items.diamond);
                    ee3input.add(Items.iron_ingot);
                    flag = false;
                    break;
                }
            }
        }
        if (flag) {
            ee3input.add(anInput);
        }
    }
    EE3Integration.addRecipe(this.getRecipeOutput().copy(), ee3input.toArray());
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:26,代码来源:RecipeUnstableCrafting.java

示例3: loadUsageRecipes

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public void loadUsageRecipes(final ItemStack ingredient) {
    for (final IRecipe irecipe : EnderConstructorRecipesHandler.recipes) {
        ShapedRecipeHandler.CachedShapedRecipe recipe = null;
        if (irecipe instanceof ShapedRecipes) {
            recipe = new ShapedRecipeHandler.CachedShapedRecipe((ShapedRecipes)irecipe);
        }
        else if (irecipe instanceof ShapedOreRecipe) {
            recipe = this.forgeShapedRecipe((ShapedOreRecipe)irecipe);
        }
        if (recipe != null) {
            if (!recipe.contains((Collection)recipe.ingredients, ingredient.getItem())) {
                continue;
            }
            recipe.computeVisuals();
            if (!recipe.contains((Collection)recipe.ingredients, ingredient)) {
                continue;
            }
            recipe.setIngredientPermutation((Collection)recipe.ingredients, ingredient);
            this.arecipes.add(recipe);
        }
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:23,代码来源:EnderConstructorHandler.java

示例4: loadCraftingRecipes

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public void loadCraftingRecipes(final String outputId, final Object... results) {
    if (outputId.equals(this.getOverlayIdentifier())) {
        for (final IRecipe irecipe : EnderConstructorRecipesHandler.recipes) {
            ShapedRecipeHandler.CachedShapedRecipe recipe = null;
            if (irecipe instanceof ShapedRecipes) {
                recipe = new ShapedRecipeHandler.CachedShapedRecipe((ShapedRecipes)irecipe);
            }
            else if (irecipe instanceof ShapedOreRecipe) {
                recipe = this.forgeShapedRecipe((ShapedOreRecipe)irecipe);
            }
            if (recipe == null) {
                continue;
            }
            recipe.computeVisuals();
            this.arecipes.add(recipe);
        }
    }
    else if (outputId.equals("item")) {
        this.loadCraftingRecipes((ItemStack)results[0]);
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:22,代码来源:EnderConstructorHandler.java

示例5: registerRecipe

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public static void registerRecipe(final Class<? extends IRecipe> recipe) {
    if (ExtraUtils.registeredRecipes.contains(recipe)) {
        return;
    }
    if (!recipe.getName().startsWith("com.rwtema.")) {
        return;
    }
    ExtraUtils.registeredRecipes.add(recipe);
    LogHelper.fine("Registering " + recipe.getSimpleName() + " to RecipeSorter", new Object[0]);
    if (ShapedOreRecipe.class.isAssignableFrom(recipe)) {
        RecipeSorter.register("extrautils:" + recipe.getSimpleName(), (Class)recipe, RecipeSorter.Category.SHAPED, "after:forge:shapedore");
    }
    else if (ShapelessOreRecipe.class.isAssignableFrom(recipe)) {
        RecipeSorter.register("extrautils:" + recipe.getSimpleName(), (Class)recipe, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
    }
    else if (ShapedRecipes.class.isAssignableFrom(recipe)) {
        RecipeSorter.register("extrautils:" + recipe.getSimpleName(), (Class)recipe, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless");
    }
    else if (ShapelessRecipes.class.isAssignableFrom(recipe)) {
        RecipeSorter.register("extrautils:" + recipe.getSimpleName(), (Class)recipe, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless before:minecraft:bookcloning");
    }
    else {
        RecipeSorter.register("extrautils:" + recipe.getSimpleName(), (Class)recipe, RecipeSorter.Category.SHAPELESS, "after:forge:shapelessore");
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:26,代码来源:ExtraUtils.java

示例6: loadCraftingRecipes

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:ShapedRecipeHandler.java

示例7: loadUsageRecipes

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
@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);
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:ShapedRecipeHandler.java

示例8: forgeShapedRecipe

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public CachedShapedRecipe forgeShapedRecipe(ShapedOreRecipe recipe) {
    int width;
    int height;
    try {
        width = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 4);
        height = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 5);
    } catch (Exception e) {
        NEIClientConfig.logger.error("Error loading recipe", e);
        return null;
    }

    Object[] items = recipe.getInput();
    for (Object item : items)
        if (item instanceof List && ((List<?>) item).isEmpty())//ore handler, no ores
            return null;

    return new CachedShapedRecipe(width, height, items, recipe.getRecipeOutput());
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:ShapedRecipeHandler.java

示例9: forgeShapedRecipe

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public CachedShapedRecipe forgeShapedRecipe(ShapedOreRecipe recipe) {
    int width;
    int height;
    try {
        width = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 4);
        height = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 5);
    } catch (Exception e) {
        LogHelper.errorError("Error loading recipe", e);
        return null;
    }

    Object[] items = recipe.getInput();
    for (Object item : items) {
        if (item instanceof List && ((List<?>) item).isEmpty())//ore handler, no ores
        {
            return null;
        }
    }

    return new CachedShapedRecipe(width, height, items, recipe.getRecipeOutput());
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:22,代码来源:ShapedRecipeHandler.java

示例10: buildHandlerMap

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
private static void buildHandlerMap()
{
	// RecipesMapExtending extends ShapedRecipes, and causes a crash when attempting to uncraft a map
	HANDLERS.put(RecipesMapExtending.class, null);

	// vanilla Minecraft recipe handlers
	HANDLERS.put(ShapedRecipes.class, new ShapedRecipeHandler());
	HANDLERS.put(ShapelessRecipes.class, new ShapelessRecipeHandler());
	HANDLERS.put(RecipeFireworks.class, new FireworksRecipeHandler());
	HANDLERS.put(RecipeTippedArrow.class, new TippedArrowRecipeHandler());

	// Forge Ore Dictionary recipe handlers
	HANDLERS.put(ShapedOreRecipe.class, new ShapedOreRecipeHandler());
	HANDLERS.put(ShapelessOreRecipe.class, new ShapelessOreRecipeHandler());

	// cofh recipe handlers
	if (CoFHRecipeHandlers.CoverRecipeHandler.recipeClass != null) HANDLERS.put(CoFHRecipeHandlers.CoverRecipeHandler.recipeClass, new CoFHRecipeHandlers.CoverRecipeHandler());

	// industrialcraft 2 recipe handlers
	if (ShapedIC2RecipeHandler.recipeClass != null) HANDLERS.put(ShapedIC2RecipeHandler.recipeClass, new ShapedIC2RecipeHandler());
	if (ShapelessIC2RecipeHandler.recipeClass != null) HANDLERS.put(ShapelessIC2RecipeHandler.recipeClass, new ShapelessIC2RecipeHandler());

	// tinker's construct recipe handlers
	if (TinkersRecipeHandlers.TableRecipeHandler.recipeClass != null) HANDLERS.put(TinkersRecipeHandlers.TableRecipeHandler.recipeClass, new TinkersRecipeHandlers.TableRecipeHandler());
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:26,代码来源:RecipeHandlers.java

示例11: registerUncraftingRecipes

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
private void registerUncraftingRecipes()
{
	// damaged anvil recipes
	UncraftingManager.addUncraftingRecipe(new ShapedOreRecipe(new ResourceLocation(ModUncrafting.MODID, "damaged_anvil_1"), new ItemStack(Blocks.ANVIL, 1, 1), new Object[] { "B B", " I ", "I I", 'B', "blockIron", 'I', "ingotIron" }));
	UncraftingManager.addUncraftingRecipe(new ShapedOreRecipe(new ResourceLocation(ModUncrafting.MODID, "damaged_anvil_2"), new ItemStack(Blocks.ANVIL, 1, 2), new Object[] { "B  ", " I ", "  I", 'B', "blockIron", 'I', "ingotIron" }));

	if (!Loader.isModLoaded("craftablehorsearmour"))
	{
		// horse armor recipes
		UncraftingManager.addUncraftingRecipe(new ShapedOreRecipe(new ResourceLocation(ModUncrafting.MODID, "iron_horse_armor"), Items.IRON_HORSE_ARMOR, new Object[] { "  I", "IWI", "III", 'I', "ingotIron", 'W', Item.getItemFromBlock(Blocks.WOOL) }));
		UncraftingManager.addUncraftingRecipe(new ShapedOreRecipe(new ResourceLocation(ModUncrafting.MODID, "golden_horse_armor"), Items.GOLDEN_HORSE_ARMOR, new Object[] { "  G", "GWG", "GGG", 'G', "ingotGold", 'W', new ItemStack(Item.getItemFromBlock(Blocks.WOOL), 1, 4) }));
		UncraftingManager.addUncraftingRecipe(new ShapedOreRecipe(new ResourceLocation(ModUncrafting.MODID, "diamond_horse_armor"), Items.DIAMOND_HORSE_ARMOR, new Object[] { "  D", "DWD", "DDD", 'D', "gemDiamond", 'W', new ItemStack(Item.getItemFromBlock(Blocks.WOOL), 1, 3) }));
		// saddle recipe
		UncraftingManager.addUncraftingRecipe(new ShapedOreRecipe(new ResourceLocation(ModUncrafting.MODID, "saddle"), Items.SADDLE, new Object[] { "LLL", "S S", "I I", 'L', "leather", 'S', Items.STRING, 'I', "ingotIron" }));
	}
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:17,代码来源:CommonProxy.java

示例12: init

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public static void init() {
	GameRegistry.addRecipe(new RecipeScrewDriver());

	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.LENS, 3), "AAA", 'A', "blockGlass"));
	GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.REFLECTIVE_ALLOY, 2), Items.IRON_INGOT, Items.GOLD_INGOT));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.ASSEMBLY_TABLE), "ABA", "A A", "AAA", 'A', "ingotIron", 'B', ModBlocks.LENS));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.MAGNIFIER), "ABA", "A A", "A A", 'A', "ingotIron", 'B', ModBlocks.LENS));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.SCREW_DRIVER), " AA", " BA", "B  ", 'A', "ingotIron", 'B', Items.STICK));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.LASER_PEN), "  A", " BC", "D  ", 'A', Blocks.STONE_BUTTON, 'B', "dustRedstone", 'C', "ingotIron", 'D', "blockGlass"));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.REFLECTIVE_ALLOY_BLOCK), "AAA", "AAA", "AAA", 'A', ModItems.REFLECTIVE_ALLOY));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.GRENADE, 3), " A ", "ABA", " A ", 'A', ModItems.REFLECTIVE_ALLOY, 'B', Blocks.TNT));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.HELMET), "AAA", "A A", "   ", 'A', ModItems.REFLECTIVE_ALLOY));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.CHESTPLATE), "A A", "AAA", "AAA", 'A', ModItems.REFLECTIVE_ALLOY));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.LEGGINGS), "AAA", "A A", "A A", 'A', ModItems.REFLECTIVE_ALLOY));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.BOOTS), "   ", "A A", "A A", 'A', ModItems.REFLECTIVE_ALLOY));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.LIGHT_CARTRIDGE), " A ", "ABA", " A ", 'A', ModItems.REFLECTIVE_ALLOY, 'B', Blocks.GLASS_PANE));
	GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.SPECTROMETER), "ABC", "DEF", "DDD", 'A', "dyeRed", 'B', "dyeGreen", 'C', "dyeBlue", 'D', "ingotIron", 'F', "paneGlass", 'E', LibOreDict.REFLECTIVE_ALLOY));
	GameRegistry.addShapelessRecipe(new ItemStack(ModItems.BOOK), ModItems.LASER_PEN, Items.BOOK);

	if (!ConfigValues.DISABLE_PHOTON_CANNON)
		GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.PHOTON_CANNON), " BA", "CDB", "EC ", 'A', ModBlocks.LENS, 'B', ModBlocks.MIRROR, 'C', ModItems.REFLECTIVE_ALLOY, 'D', ModBlocks.ELECTRON_EXCITER, 'E', ModBlocks.SENSOR));
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:23,代码来源:CraftingRecipes.java

示例13: registerPipeRecipe

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
public static void registerPipeRecipe(Item out, Item frame, Object sec1, Object sec2) {
	if (sec1 == null) {
		GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(out, 8), new Object [] {
				" G ", "GFG", " G ",
				'G', Blocks.glass_pane,
				'F', frame
		}));
	} else {
		GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(out, 8), new Object [] {
				"1G2", "GFG", "2G1",
				'G', Blocks.glass_pane,
				'F', frame,
				'1', sec1,
				'2', sec2 == null ? sec1 : sec2
		}));
		GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(out, 8), new Object [] {
				"2G1", "GFG", "1G2",
				'G', Blocks.glass_pane,
				'F', frame,
				'1', sec1,
				'2', sec2 == null ? sec1 : sec2
		}));
	}
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:25,代码来源:TFCTechBCTransport.java

示例14: setup

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
static void setup() {
    if (is_setup) return;
    is_setup = true;
    reg(ItemStack.class, new WriteItemStack());
    reg(Item.class, new WriteItem());
    reg(Block.class, new WriteBlock());
    reg(String.class, new WriteStringOreDictionary());
    reg(Number.class, new WriteObjectToString());
    reg(NBTBase.class, new WriteObjectToString());
    reg(FluidStack.class, new WriteFluidStack());
    reg(Fluid.class, new WriteFluid());
    reg(Collection.class, new WriteCollection());
    // IRecipe: "embedded IRecipe"; haven't seen it crop up tho
    reg(ShapedOreRecipe.class, new WriteShapedOreRecipe());
    reg(ShapedRecipes.class, new WriteShapedRecipe());
    reg(ShapelessOreRecipe.class, new WriteShapelessOreRecipe());
    reg(ShapelessRecipes.class, new WriteShapelessRecipe());
    reg(Map.Entry.class, new WriteEntry());

    IObjectWriter.adapter.register(new ArrayAdapter());
    IObjectWriter.adapter.setFallbackAdapter(new GenericAdapter<Object, IObjectWriter>(Object.class, new ReflectionWriter()));
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:23,代码来源:StandardObjectWriters.java

示例15: loadCraftingRecipes

import net.minecraftforge.oredict.ShapedOreRecipe; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
    if (outputId.equals("crafting") && getClass() == ShapedRecipeHandler.class) {
        for (IRecipe 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);
    }
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:23,代码来源:ShapedRecipeHandler.java


注:本文中的net.minecraftforge.oredict.ShapedOreRecipe类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。