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


Java ItemStack.field_190927_a方法代码示例

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


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

示例1: detectAndSendChanges

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Looks for changes made in the container, sends them to every listener.
 */
public void detectAndSendChanges()
{
    for (int i = 0; i < this.inventorySlots.size(); ++i)
    {
        ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack();
        ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i);

        if (!ItemStack.areItemStacksEqual(itemstack1, itemstack))
        {
            itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.copy();
            this.inventoryItemStacks.set(i, itemstack1);

            for (int j = 0; j < this.listeners.size(); ++j)
            {
                ((IContainerListener)this.listeners.get(j)).sendSlotContents(this, i, itemstack1);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:Container.java

示例2: notifyDataManagerChange

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void notifyDataManagerChange(DataParameter<?> key)
{
    super.notifyDataManagerChange(key);

    if (HAND_STATES.equals(key) && this.world.isRemote)
    {
        if (this.isHandActive() && this.activeItemStack.func_190926_b())
        {
            this.activeItemStack = this.getHeldItem(this.getActiveHand());

            if (!this.activeItemStack.func_190926_b())
            {
                this.activeItemStackUseCount = this.activeItemStack.getMaxItemUseDuration();
            }
        }
        else if (!this.isHandActive() && !this.activeItemStack.func_190926_b())
        {
            this.activeItemStack = ItemStack.field_190927_a;
            this.activeItemStackUseCount = 0;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:EntityLivingBase.java

示例3: decrStackSize

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Removes up to a specified number of items from an inventory slot and returns them in a new stack.
 */
public ItemStack decrStackSize(int index, int count)
{
    List<ItemStack> list = null;

    for (NonNullList<ItemStack> nonnulllist : this.allInventories)
    {
        if (index < nonnulllist.size())
        {
            list = nonnulllist;
            break;
        }

        index -= nonnulllist.size();
    }

    return list != null && !((ItemStack)list.get(index)).func_190926_b() ? ItemStackHelper.getAndSplit(list, index, count) : ItemStack.field_190927_a;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:InventoryPlayer.java

示例4: damageShield

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
protected void damageShield(float damage)
{
    if (damage >= 3.0F && this.activeItemStack.getItem() == Items.SHIELD)
    {
        int i = 1 + MathHelper.floor(damage);
        this.activeItemStack.damageItem(i, this);

        if (this.activeItemStack.func_190926_b())
        {
            EnumHand enumhand = this.getActiveHand();

            if (enumhand == EnumHand.MAIN_HAND)
            {
                this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, ItemStack.field_190927_a);
            }
            else
            {
                this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, ItemStack.field_190927_a);
            }

            this.activeItemStack = ItemStack.field_190927_a;
            this.playSound(SoundEvents.ITEM_SHIELD_BREAK, 0.8F, 0.8F + this.world.rand.nextFloat() * 0.4F);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:EntityPlayer.java

示例5: removeStackFromSlot

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Removes a stack from the given slot and returns it.
 */
public ItemStack removeStackFromSlot(int index)
{
    if (index == 0)
    {
        ItemStack itemstack = this.payment;
        this.payment = ItemStack.field_190927_a;
        return itemstack;
    }
    else
    {
        return ItemStack.field_190927_a;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:TileEntityBeacon.java

示例6: MerchantRecipe

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public MerchantRecipe(NBTTagCompound tagCompound)
{
    this.itemToBuy = ItemStack.field_190927_a;
    this.secondItemToBuy = ItemStack.field_190927_a;
    this.itemToSell = ItemStack.field_190927_a;
    this.readFromTags(tagCompound);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:MerchantRecipe.java

示例7: findMatchingRecipe

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Retrieves an ItemStack that has multiple recipes for it.
 */
public ItemStack findMatchingRecipe(InventoryCrafting craftMatrix, World worldIn)
{
    for (IRecipe irecipe : this.recipes)
    {
        if (irecipe.matches(craftMatrix, worldIn))
        {
            return irecipe.getCraftingResult(craftMatrix);
        }
    }

    return ItemStack.field_190927_a;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:CraftingManager.java

示例8: CPacketCreativeInventoryAction

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public CPacketCreativeInventoryAction(int slotIdIn, ItemStack stackIn)
{
    this.slotId = slotIdIn;
    this.stack = stackIn.func_190926_b() ? ItemStack.field_190927_a : stackIn.copy();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:CPacketCreativeInventoryAction.java

示例9: func_190732_dj

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
protected ItemStack func_190732_dj()
{
    return ItemStack.field_190927_a;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:EntityZombieVillager.java

示例10: clear

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void clear()
{
    this.payment = ItemStack.field_190927_a;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:TileEntityBeacon.java

示例11: matches

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean matches(InventoryCrafting inv, World worldIn)
{
    ItemStack itemstack = ItemStack.field_190927_a;
    ItemStack itemstack1 = ItemStack.field_190927_a;

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

        if (!itemstack2.func_190926_b())
        {
            if (itemstack2.getItem() != Items.BANNER)
            {
                return false;
            }

            if (!itemstack.func_190926_b() && !itemstack1.func_190926_b())
            {
                return false;
            }

            EnumDyeColor enumdyecolor = ItemBanner.getBaseColor(itemstack2);
            boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0;

            if (!itemstack.func_190926_b())
            {
                if (flag)
                {
                    return false;
                }

                if (enumdyecolor != ItemBanner.getBaseColor(itemstack))
                {
                    return false;
                }

                itemstack1 = itemstack2;
            }
            else if (!itemstack1.func_190926_b())
            {
                if (!flag)
                {
                    return false;
                }

                if (enumdyecolor != ItemBanner.getBaseColor(itemstack1))
                {
                    return false;
                }

                itemstack = itemstack2;
            }
            else if (flag)
            {
                itemstack = itemstack2;
            }
            else
            {
                itemstack1 = itemstack2;
            }
        }
    }

    return !itemstack.func_190926_b() && !itemstack1.func_190926_b();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:66,代码来源:RecipesBanners.java

示例12: transferStackInSlot

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Take a stack from the specified inventory slot.
 */
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
    ItemStack itemstack = ItemStack.field_190927_a;
    Slot slot = (Slot)this.inventorySlots.get(index);

    if (slot != null && slot.getHasStack())
    {
        ItemStack itemstack1 = slot.getStack();
        itemstack = itemstack1.copy();

        if (index < 9)
        {
            if (!this.mergeItemStack(itemstack1, 9, 45, true))
            {
                return ItemStack.field_190927_a;
            }
        }
        else if (!this.mergeItemStack(itemstack1, 0, 9, false))
        {
            return ItemStack.field_190927_a;
        }

        if (itemstack1.func_190926_b())
        {
            slot.putStack(ItemStack.field_190927_a);
        }
        else
        {
            slot.onSlotChanged();
        }

        if (itemstack1.func_190916_E() == itemstack.func_190916_E())
        {
            return ItemStack.field_190927_a;
        }

        slot.func_190901_a(playerIn, itemstack1);
    }

    return itemstack;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:ContainerDispenser.java

示例13: getStackInSlot

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Returns the stack in the given slot.
 */
public ItemStack getStackInSlot(int index)
{
    return index >= 0 && index < this.brewingItemStacks.size() ? (ItemStack)this.brewingItemStacks.get(index) : ItemStack.field_190927_a;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:TileEntityBrewingStand.java

示例14: matches

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean matches(InventoryCrafting inv, World worldIn)
{
    ItemStack itemstack = ItemStack.field_190927_a;
    ItemStack itemstack1 = ItemStack.field_190927_a;

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

        if (!itemstack2.func_190926_b())
        {
            if (itemstack2.getItem() == Items.BANNER)
            {
                if (!itemstack1.func_190926_b())
                {
                    return false;
                }

                itemstack1 = itemstack2;
            }
            else
            {
                if (itemstack2.getItem() != Items.SHIELD)
                {
                    return false;
                }

                if (!itemstack.func_190926_b())
                {
                    return false;
                }

                if (itemstack2.getSubCompound("BlockEntityTag") != null)
                {
                    return false;
                }

                itemstack = itemstack2;
            }
        }
    }

    if (!itemstack.func_190926_b() && !itemstack1.func_190926_b())
    {
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:52,代码来源:ShieldRecipes.java

示例15: getItem

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
    Item item = this.getSeedItem();
    return item == null ? ItemStack.field_190927_a : new ItemStack(item);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:BlockStem.java


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