本文整理汇总了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;
}
示例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());
}
示例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));
}
}
示例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());
}
示例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;
}
示例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);
}
示例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;
}
示例8: ExtendedCachedShapelessRecipe
import net.minecraftforge.oredict.ShapelessOreRecipe; //导入方法依赖的package包/类
public ExtendedCachedShapelessRecipe(ShapelessOreRecipe rec) {
this(rec.getInput(), Arrays.asList(rec.getRecipeOutput()));
}
示例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();
}