當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。