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


Java InventoryCrafting.getStackInSlot方法代码示例

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


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

示例1: getRemainingItems

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
    NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191197_a(inv.getSizeInventory(), ItemStack.field_190927_a);

    for (int i = 0; i < nonnulllist.size(); ++i)
    {
        ItemStack itemstack = inv.getStackInSlot(i);

        if (itemstack.getItem().hasContainerItem())
        {
            nonnulllist.set(i, new ItemStack(itemstack.getItem().getContainerItem()));
        }
    }

    return nonnulllist;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:RecipeFireworks.java

示例2: getRemainingItems

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
public ItemStack[] getRemainingItems(InventoryCrafting inv)
{
    ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()];

    for (int i = 0; i < aitemstack.length; ++i)
    {
        ItemStack itemstack = inv.getStackInSlot(i);

        if (itemstack != null && itemstack.getItem().hasContainerItem())
        {
            aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem());
        }
    }

    return aitemstack;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:RecipesMapCloning.java

示例3: getAAFromMatrix

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
private ItemStack getAAFromMatrix(InventoryCrafting matrix)
{
	int counter = 0;
	
	while (counter < matrix.getSizeInventory())
	{
		if (matrix.getStackInSlot(counter) != null && matrix.getStackInSlot(counter).getItem() instanceof PackedUpAA)
		{
			return matrix.getStackInSlot(counter);	// Found it
		}
		
		counter += 1;
	}
	
	return null;
}
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:17,代码来源:Recipe_AA_Plating.java

示例4: getRemainingItems

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
    NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>func_191197_a(inv.getSizeInventory(), ItemStack.field_190927_a);

    for (int i = 0; i < nonnulllist.size(); ++i)
    {
        ItemStack itemstack = inv.getStackInSlot(i);

        if (!itemstack.func_190926_b())
        {
            if (itemstack.getItem().hasContainerItem())
            {
                nonnulllist.set(i, new ItemStack(itemstack.getItem().getContainerItem()));
            }
            else if (itemstack.hasTagCompound() && TileEntityBanner.getPatterns(itemstack) > 0)
            {
                ItemStack itemstack1 = itemstack.copy();
                itemstack1.func_190920_e(1);
                nonnulllist.set(i, itemstack1);
            }
        }
    }

    return nonnulllist;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:RecipesBanners.java

示例5: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
@Override
public boolean matches(InventoryCrafting inv, World worldIn) {
	int slots = inv.getHeight() * inv.getWidth();
	int center = (int) ((float)slots / 2F);
	ItemStack checked = inv.getStackInSlot(center);
	if(checked.isEmpty() || !checked.hasTagCompound()) return false;
	int amount = 0;

	for(int j = 0; j < slots; j++) {
		ItemStack stack = inv.getStackInSlot(j);
		if(!stack.isEmpty() && (!hasTag(stack) || stack.getItem() != checked.getItem())) return false;
		if(!stack.isEmpty() && j != center) {
			amount++;
		}
	}

	return amount > 0;
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:19,代码来源:EntangledCloningRecipe.java

示例6: getCraftingResult

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
	ItemStack inputSlaw = inv.getStackInSlot(0);

	byte additions = 0;
	if (inputSlaw.hasTagCompound()) {
		additions = inputSlaw.getTagCompound().getByte("additions");
	}
	additions += 1;

	ItemStack outputStack = new ItemStack(ModItems.simic_slaw);
	outputStack.setTagCompound(new NBTTagCompound());
	outputStack.getTagCompound().setByte("additions", additions);

	return outputStack;
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:17,代码来源:RecipeSimicSlaw.java

示例7: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
@Override
public boolean matches(InventoryCrafting inv, World worldIn) {
    int count = 0;
    boolean forge = false;
    for (int i = 0; i < inv.getSizeInventory(); i++) {
        ItemStack stack = inv.getStackInSlot(i);
        if(!stack.isEmpty()) {
            if(stack.getItem() instanceof ItemBlock && ((ItemBlock) stack.getItem()).getBlock() instanceof CraftiniumForge) {
                if(forge && !this.combining) {
                    return false;
                } else {
                    forge = true;
                    if(!stack.hasTagCompound() || stack.getSubCompound("randores") == null || !stack.getSubCompound("randores").hasKey("furnace_speed")) {
                        return false;
                    }
                }
            } else if (this.upgrades.keySet().stream().noneMatch(k -> k.apply(stack))) {
                return false;
            }
            count++;
        }
    }
    return count >= 2 && forge;
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:25,代码来源:RandoresForgeUpgradeRecipe.java

示例8: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
@Override
public boolean matches(InventoryCrafting inv, World worldIn)
{
	ItemStack tempStack = ItemStack.EMPTY;
	if (VALID_ITEMS == null) buildValidItemsArray();

	int potionEffects = 0;
	for (int i = 0; i < inv.getSizeInventory(); i++)
	{
		ItemStack stack = inv.getStackInSlot(i);
		if (!stack.isEmpty())
		{
			Item item = stack.getItem();
			if (!ArrayUtils.contains(VALID_ITEMS, item)) return false;

			if (tempStack.isEmpty())
			{
				tempStack = stack.copy();
			}
			else
			{
				if (!canCombineItems(tempStack, stack)) return false;
			}

			if (ModConfiguration.maxPotionEffects >= 0)
			{
				potionEffects += getEffectsFromStack(stack).size();
				if (potionEffects > ModConfiguration.maxPotionEffects) return false;
			}
		}
	}

	return true;
}
 
开发者ID:crazysnailboy,项目名称:CombinedPotions,代码行数:35,代码来源:RecipeCombinedPotions2.java

示例9: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    if (!super.matches(inv, worldIn))
    {
        return false;
    }
    else
    {
        ItemStack itemstack = ItemStack.field_190927_a;

        for (int i = 0; i < inv.getSizeInventory() && itemstack.func_190926_b(); ++i)
        {
            ItemStack itemstack1 = inv.getStackInSlot(i);

            if (itemstack1.getItem() == Items.FILLED_MAP)
            {
                itemstack = itemstack1;
            }
        }

        if (itemstack.func_190926_b())
        {
            return false;
        }
        else
        {
            MapData mapdata = Items.FILLED_MAP.getMapData(itemstack, worldIn);
            return mapdata == null ? false : (this.func_190934_a(mapdata) ? false : mapdata.scale < 4);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:35,代码来源:RecipesMapExtending.java

示例10: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    int i = 0;
    ItemStack itemstack = null;

    for (int j = 0; j < inv.getSizeInventory(); ++j)
    {
        ItemStack itemstack1 = inv.getStackInSlot(j);

        if (itemstack1 != null)
        {
            if (itemstack1.getItem() == Items.filled_map)
            {
                if (itemstack != null)
                {
                    return false;
                }

                itemstack = itemstack1;
            }
            else
            {
                if (itemstack1.getItem() != Items.map)
                {
                    return false;
                }

                ++i;
            }
        }
    }

    return itemstack != null && i > 0;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:38,代码来源:RecipesMapCloning.java

示例11: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    if (!super.matches(inv, worldIn))
    {
        return false;
    }
    else
    {
        ItemStack itemstack = null;

        for (int i = 0; i < inv.getSizeInventory() && itemstack == null; ++i)
        {
            ItemStack itemstack1 = inv.getStackInSlot(i);

            if (itemstack1 != null && itemstack1.getItem() == Items.filled_map)
            {
                itemstack = itemstack1;
            }
        }

        if (itemstack == null)
        {
            return false;
        }
        else
        {
            MapData mapdata = Items.filled_map.getMapData(itemstack, worldIn);
            return mapdata == null ? false : mapdata.scale < 4;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:35,代码来源:RecipesMapExtending.java

示例12: getRemainingItems

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
public ItemStack[] getRemainingItems(InventoryCrafting inv)
{
    ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()];

    for (int i = 0; i < aitemstack.length; ++i)
    {
        ItemStack itemstack = inv.getStackInSlot(i);
        aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack);
    }

    return aitemstack;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:ShapedRecipes.java

示例13: findHelmet

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
private ItemStack findHelmet(InventoryCrafting inv) {
    for (int i = 0; i < inv.getSizeInventory(); i++) {
        if (inv.getStackInSlot(i).getItem() == Itemss.PNEUMATIC_HELMET) {
            return inv.getStackInSlot(i);
        }
    }
    return ItemStack.EMPTY;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:RecipeOneProbe.java

示例14: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    ItemStack itemstack = null;
    List<ItemStack> list = Lists.<ItemStack>newArrayList();

    for (int i = 0; i < inv.getSizeInventory(); ++i)
    {
        ItemStack itemstack1 = inv.getStackInSlot(i);

        if (itemstack1 != null)
        {
            if (itemstack1.getItem() instanceof ItemArmor)
            {
                ItemArmor itemarmor = (ItemArmor)itemstack1.getItem();

                if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null)
                {
                    return false;
                }

                itemstack = itemstack1;
            }
            else
            {
                if (itemstack1.getItem() != Items.dye)
                {
                    return false;
                }

                list.add(itemstack1);
            }
        }
    }

    return itemstack != null && !list.isEmpty();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:RecipesArmorDyes.java

示例15: matches

import net.minecraft.inventory.InventoryCrafting; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    List<ItemStack> list = Lists.<ItemStack>newArrayList();

    for (int i = 0; i < inv.getSizeInventory(); ++i)
    {
        ItemStack itemstack = inv.getStackInSlot(i);

        if (itemstack != null)
        {
            list.add(itemstack);

            if (list.size() > 1)
            {
                ItemStack itemstack1 = (ItemStack)list.get(0);

                if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable())
                {
                    return false;
                }
            }
        }
    }

    return list.size() == 2;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:RecipeRepairItem.java


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