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


Java ShapelessOreRecipe.getInput方法代码示例

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


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

示例1: 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

示例2: forgeShapelessRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
public CachedShapelessRecipe forgeShapelessRecipe(ShapelessOreRecipe recipe) {
    ArrayList<Object> items = recipe.getInput();

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

    return new CachedShapelessRecipe(items, recipe.getRecipeOutput());
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:ShapelessRecipeHandler.java

示例3: writeObject

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
@Override
public void writeObject(List out, ShapelessOreRecipe val, IObjectWriter<Object> generic) {
    ArrayList<Object> input = val.getInput();
    if (input == null) return;
    out.add("Shapeless: ");
    for (Object obj : input) {
        out.add(stackOreDictionary(obj));
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:10,代码来源:StandardObjectWriters.java

示例4: forgeShapelessRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
public CachedShapelessRecipe forgeShapelessRecipe(ShapelessOreRecipe recipe) {
    List<Object> items = recipe.getInput();

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

    return new CachedShapelessRecipe(items, recipe.getRecipeOutput());
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:13,代码来源:ShapelessRecipeHandler.java

示例5: getNBTFromRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
@Override
public NBTTagCompound getNBTFromRecipe(ShapelessOreRecipe recipe, ItemStack newOutput) throws IllegalAccessException
{
    NBTTagCompound nbtRecipe = new NBTTagCompound();
    NBTTagList nbtInput = new NBTTagList();

    for (Object o : recipe.getInput())
    {
        if (o instanceof ArrayList)
        {
            for (String name : OreDictionary.getOreNames())
            {
                if (OreDictionary.getOres(name).equals(o))
                {
                    NBTTagCompound tag = new NBTTagCompound();
                    tag.setString(NBT_oredictname, name);
                    nbtInput.appendTag(tag);
                    break;
                }
            }
        }
        else if (o instanceof ItemStack)
        {
            nbtInput.appendTag(((ItemStack) o).writeToNBT(new NBTTagCompound()));
        }
        else
        {
            CrayCrafting.instance.logger.warn("NBT RECIPE ERROR: " + o + " IS NOT STRING OR ITEMSTACK ???");
        }
    }
    nbtRecipe.setTag(NBT_input, nbtInput);
    nbtRecipe.setTag(NBT_newOutput, newOutput.writeToNBT(new NBTTagCompound()));
    nbtRecipe.setTag(NBT_oldOutput, recipe.getRecipeOutput().writeToNBT(new NBTTagCompound()));

    return nbtRecipe;
}
 
开发者ID:DoubleDoorDevelopment,项目名称:CrayCrafting,代码行数:37,代码来源:ShapelessOreRecipeType.java

示例6: getCachedOreRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
private CachedRollingMachineShapelessRecipe getCachedOreRecipe(ShapelessOreRecipe recipe, boolean genPerms) {
    ArrayList<Object> items = recipe.getInput();
    for (Object item : items) {
        if (item instanceof List && ((List<?>) item).isEmpty()) {
            return null;
        }
    }
    return new CachedRollingMachineShapelessRecipe(items, recipe.getRecipeOutput(), genPerms);
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:10,代码来源:RecipeHandlerRollingMachineShapeless.java

示例7: getNBTFromRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
@Override
public NBTTagCompound getNBTFromRecipe(ShapelessOreRecipe recipe, ItemStack newOutput) throws IllegalAccessException
{
    NBTTagCompound nbtRecipe = new NBTTagCompound();
    NBTTagList nbtInput = new NBTTagList();

    for (Object o : recipe.getInput())
    {
        if (o instanceof ArrayList)
        {
            for (String name : OreDictionary.getOreNames())
            {
                if (OreDictionary.getOres(name).equals(o))
                {
                    NBTTagCompound tag = new NBTTagCompound();
                    tag.setString(NBT_oredictname, name);
                    nbtInput.appendTag(tag);
                    break;
                }
            }
        }
        else if (o instanceof ItemStack)
        {
            nbtInput.appendTag(((ItemStack) o).writeToNBT(new NBTTagCompound()));
        }
        else
        {
            NucleumOmnium.getLogger().severe("[OreDictionaryFixes] NBT RECIPE ERROR: " + o + " IS NOT STRING OR ITEMSTACK ???");
        }
    }
    nbtRecipe.setTag(NBT_input, nbtInput);
    nbtRecipe.setCompoundTag(NBT_output, newOutput.writeToNBT(new NBTTagCompound()));

    return nbtRecipe;
}
 
开发者ID:CCM-Modding,项目名称:Nucleum-Omnium,代码行数:36,代码来源:ShapelessOreRecipeType.java

示例8: ExtendedCachedShapelessRecipe

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
public ExtendedCachedShapelessRecipe(ShapelessOreRecipe rec) {
	this(rec.getInput(), Arrays.asList(rec.getRecipeOutput()));
}
 
开发者ID:CraftedMods,项目名称:nei-lotr,代码行数:4,代码来源:ExtendedShapelessRecipeHandler.java

示例9: matchesShapeless

import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
private static boolean matchesShapeless(ShapelessOreRecipe recipe, IInventory var1, World par2World)
{
    ArrayList<Object> required = new ArrayList<Object>(recipe.getInput());

    for (int x = 0; x < var1.getSizeInventory(); x++)
    {
        ItemStack slot = var1.getStackInSlot(x);

        if (slot != null)
        {
            boolean inRecipe = false;
            Iterator<Object> req = required.iterator();

            while (req.hasNext())
            {
                boolean match = false;

                Object next = req.next();

                if (next instanceof ItemStack)
                {
                    match = OreDictionary.itemMatches((ItemStack)next, slot, false);
                }
                else if (next instanceof ArrayList)
                {
                    Iterator<ItemStack> itr = ((ArrayList<ItemStack>)next).iterator();
                    while (itr.hasNext() && !match)
                    {
                        match = OreDictionary.itemMatches(itr.next(), slot, false);
                    }
                }

                if (match)
                {
                    inRecipe = true;
                    required.remove(next);
                    break;
                }
            }

            if (!inRecipe)
            {
                return false;
            }
        }
    }

    return required.isEmpty();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:50,代码来源:CompressorRecipes.java


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