本文整理匯總了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();
}