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


Java ShapelessOreRecipe类代码示例

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


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

示例1: getToolHeadSchematicRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
private static IRecipe getToolHeadSchematicRecipe(ItemStack output, String material, String type, int cost) {
	NonNullList<Ingredient> inputs = NonNullList.withSize(cost + 1, Ingredient.EMPTY);
	ItemStack schematic = new ItemStack(ModItems.schematic);
	NBTTagCompound nbt = new NBTTagCompound();
	nbt.setString(ItemSchematic.type_tag, type);
	schematic.setTagCompound(nbt);
	Ingredient schematicIngredient = new IngredientNBT(schematic) {

	};
	inputs.set(0, schematicIngredient);
	for (int i = 1; i <= cost; i++) {
		inputs.set(i, new OreIngredient(material));
	}

	return new ShapelessOreRecipe(null, inputs, output);
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:17,代码来源:ModRecipes.java

示例2: matchesInput

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
private boolean matchesInput(ShapelessOreRecipe recipe)
{
    if (recipe.getIngredients().size() != getRecipeSize())
        return false;

    Object[] input = getRecipeInput();

    for (int i = 0; i < recipe.getIngredients().size(); i++)
    {
        Ingredient target = recipe.getIngredients().get(i);
        Object source = input[i];

        if (!ItemHelper.isSameRecipeInput(target, source))
            return false;
    }
    return true;
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:18,代码来源:ShapelessRecipe.java

示例3: convert

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
public static JsonBrickOvenShapelessRecipe convert(ShapelessOreRecipe recipe)
{
	List<Object> inputs = new ArrayList<>();
	for (Object obj : recipe.getIngredients())
	{
		if (obj instanceof ItemStack)
		{
			inputs.add(obj);
		}
		else if (obj instanceof List)
		{
			try
			{
			    	@SuppressWarnings("unchecked")
				String ore = RegistryUtil.getCommonOreDictName((List<ItemStack>)obj);
				inputs.add(ore);
			}
			catch (ClassCastException ex)
			{
				LogUtil.log(Level.ERROR, "Failed to cast list in ore dictionary conversion: " + ex.toString());
			}
		}
	}

	return new JsonBrickOvenShapelessRecipe(recipe.getRecipeOutput(), inputs);
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:27,代码来源:BrickOvenConfig.java

示例4: registerRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的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

示例5: loadCraftingRecipes

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
    if (outputId.equals("crafting") && getClass() == ShapelessRecipeHandler.class) {
        List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
        for (IRecipe irecipe : allrecipes) {
            CachedShapelessRecipe recipe = null;
            if (irecipe instanceof ShapelessRecipes)
                recipe = shapelessRecipe((ShapelessRecipes) irecipe);
            else if (irecipe instanceof ShapelessOreRecipe)
                recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);

            if (recipe == null)
                continue;

            arecipes.add(recipe);
        }
    } else {
        super.loadCraftingRecipes(outputId, results);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:ShapelessRecipeHandler.java

示例6: loadUsageRecipes

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public void loadUsageRecipes(ItemStack ingredient) {
    List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
    for (IRecipe irecipe : allrecipes) {
        CachedShapelessRecipe recipe = null;
        if (irecipe instanceof ShapelessRecipes)
            recipe = shapelessRecipe((ShapelessRecipes) irecipe);
        else if (irecipe instanceof ShapelessOreRecipe)
            recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);

        if (recipe == null)
            continue;

        if (recipe.contains(recipe.ingredients, ingredient)) {
            recipe.setIngredientPermutation(recipe.ingredients, ingredient);
            arecipes.add(recipe);
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:ShapelessRecipeHandler.java

示例7: buildHandlerMap

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的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

示例8: getCraftingGrid

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public NonNullList<ItemStack> getCraftingGrid(IRecipe r)
{
	// cast the IRecipe instance
	ShapelessOreRecipe shapelessRecipe = (ShapelessOreRecipe)r;

	// get a copy of the recipe items with normalised metadata
	NonNullList<ItemStack> recipeStacks = copyRecipeStacks(shapelessRecipe.getIngredients()); // copyRecipeStacks(getOreRecipeItems(shapelessRecipe.getIngredients()));

	if (!recipeStacks.isEmpty())
	{
		// return the itemstacks
		return recipeStacks;
	}
	else return NonNullList.<ItemStack>create();
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:17,代码来源:RecipeHandlers.java

示例9: init

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的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

示例10: setup

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的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

示例11: loadCraftingRecipes

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
    if (outputId.equals("crafting") && getClass() == ShapelessRecipeHandler.class) {
        List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
        for (IRecipe irecipe : allrecipes) {
            CachedShapelessRecipe recipe = null;
            if (irecipe instanceof ShapelessRecipes) {
                recipe = shapelessRecipe((ShapelessRecipes) irecipe);
            } else if (irecipe instanceof ShapelessOreRecipe) {
                recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
            }

            if (recipe == null) {
                continue;
            }

            arecipes.add(recipe);
        }
    } else {
        super.loadCraftingRecipes(outputId, results);
    }
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:23,代码来源:ShapelessRecipeHandler.java

示例12: loadUsageRecipes

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public void loadUsageRecipes(ItemStack ingredient) {
    List<IRecipe> allrecipes = CraftingManager.getInstance().getRecipeList();
    for (IRecipe irecipe : allrecipes) {
        CachedShapelessRecipe recipe = null;
        if (irecipe instanceof ShapelessRecipes) {
            recipe = shapelessRecipe((ShapelessRecipes) irecipe);
        } else if (irecipe instanceof ShapelessOreRecipe) {
            recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
        }

        if (recipe == null) {
            continue;
        }

        if (recipe.contains(recipe.ingredients, ingredient)) {
            recipe.setIngredientPermutation(recipe.ingredients, ingredient);
            arecipes.add(recipe);
        }
    }
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:22,代码来源:ShapelessRecipeHandler.java

示例13: register

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public void register() {
	super.register();

	final List<ItemStack> input = new ArrayList<ItemStack>();
	input.add(new ItemStack(ItemManager.material, 1, Material.RTG_HOUSING));

	final ItemStack cell = new ItemStack(ItemManager.material, 1, Material.FUEL_CELL);

	for (int i = 1; i < 9; i++) {
		input.add(cell);

		final ItemStack rtg = new ItemStack(ItemManager.energyCell, 1, RTGEnergyCell.RTG);
		RTGEnergyCell.initialize(rtg, i);

		final ShapelessOreRecipe shapeless = new ShapelessOreRecipe(rtg, input.toArray());
		GameRegistry.addRecipe(shapeless);
	}
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:20,代码来源:RTGEnergyCell.java

示例14: getRecipes

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@Override
public List<RecipeLink> getRecipes() {
	List<RecipeLink> a = new ArrayList<RecipeLink>();
	
	for (Object obj : RecipeRegistry.vanillaCrafting.get(ShapelessOreRecipe.class)) {
		ShapelessOreRecipe recipe = (ShapelessOreRecipe) obj;
		RecipeLink link = new RecipeLink();
		
		for (Object stack : recipe.getInput()) {
			if (stack!=null) {
				link.inputs.add(new ItemDataStack(RecipeRegistry.flatten(stack)));
			}
		}
		
		link.outputs.add(new ItemDataStack(recipe.getRecipeOutput()));
		
		a.add(link);
	}
	
	return a;
}
 
开发者ID:iconmaster5326,项目名称:AetherCraft2,代码行数:22,代码来源:ShapelessOreCraftingHandler.java

示例15: addShapeless

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入依赖的package包/类
@ZenMethod
public static void addShapeless(IItemStack output, IIngredient[] inputs) {
    if (inputs == null) {
        MineTweakerAPI.getLogger().logError("Large Furnace: Input set must not be null!");
        return;
    }
    if (inputs.length == 0) {
        MineTweakerAPI.getLogger().logError("Large Furnace: Input set must not empty!");
        return;
    }
    if (output == null) {
        MineTweakerAPI.getLogger().logError("Large Furnace: Output must not be null!");
        return;
    }
    ShapelessOreRecipe recipe = constructSafely(toStack(output), toObjects(inputs));
    if (recipe == null) {
        MineTweakerAPI.getLogger().logError("Large Furnace: Illegal recipe.");
        return;
    }
    MineTweakerAPI.apply(new FurnaceAdd(output, recipe));
}
 
开发者ID:Belgabor,项目名称:AMTweaker,代码行数:22,代码来源:LargeFurnace.java


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