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


Java ItemStack.func_190926_b方法代码示例

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


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

示例1: playEquipSound

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
protected void playEquipSound(ItemStack stack)
{
    if (!stack.func_190926_b())
    {
        SoundEvent soundevent = SoundEvents.ITEM_ARMOR_EQUIP_GENERIC;
        Item item = stack.getItem();

        if (item instanceof ItemArmor)
        {
            soundevent = ((ItemArmor)item).getArmorMaterial().getSoundEvent();
        }
        else if (item == Items.ELYTRA)
        {
            soundevent = SoundEvents.field_191258_p;
        }

        this.playSound(soundevent, 1.0F, 1.0F);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:EntityLivingBase.java

示例2: onDeath

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Called when the mob's health reaches 0.
 */
public void onDeath(DamageSource cause)
{
    super.onDeath(cause);

    if (!this.world.isRemote && this.horseChest != null)
    {
        for (int i = 0; i < this.horseChest.getSizeInventory(); ++i)
        {
            ItemStack itemstack = this.horseChest.getStackInSlot(i);

            if (!itemstack.func_190926_b())
            {
                this.entityDropItem(itemstack, 0.0F);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:AbstractHorse.java

示例3: onContainerClosed

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Called when the container is closed.
 */
public void onContainerClosed(EntityPlayer playerIn)
{
    super.onContainerClosed(playerIn);

    if (!this.worldObj.isRemote)
    {
        for (int i = 0; i < 9; ++i)
        {
            ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i);

            if (!itemstack.func_190926_b())
            {
                playerIn.dropItem(itemstack, false);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:ContainerWorkbench.java

示例4: getItem

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
    TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);

    if (tileentityflowerpot != null)
    {
        ItemStack itemstack = tileentityflowerpot.getFlowerItemStack();

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

    return new ItemStack(Items.FLOWER_POT);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:BlockFlowerPot.java

示例5: getEntityEquipment

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public List<ItemStack> getEntityEquipment(EntityLivingBase entityIn)
{
    List<ItemStack> list = Lists.<ItemStack>newArrayList();

    for (EntityEquipmentSlot entityequipmentslot : this.applicableEquipmentTypes)
    {
        ItemStack itemstack = entityIn.getItemStackFromSlot(entityequipmentslot);

        if (!itemstack.func_190926_b())
        {
            list.add(itemstack);
        }
    }

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

示例6: onContainerClosed

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Called when the container is closed.
 */
public void onContainerClosed(EntityPlayer playerIn)
{
    super.onContainerClosed(playerIn);

    for (int i = 0; i < 4; ++i)
    {
        ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i);

        if (!itemstack.func_190926_b())
        {
            playerIn.dropItem(itemstack, false);
        }
    }

    this.craftResult.setInventorySlotContents(0, ItemStack.field_190927_a);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:ContainerPlayer.java

示例7: getCraftingResult

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    for (int i = 0; i < inv.getSizeInventory(); ++i)
    {
        ItemStack itemstack = inv.getStackInSlot(i);

        if (!itemstack.func_190926_b() && TileEntityBanner.getPatterns(itemstack) > 0)
        {
            ItemStack itemstack1 = itemstack.copy();
            itemstack1.func_190920_e(1);
            return itemstack1;
        }
    }

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

示例8: matches

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

    for (int i = 0; i < inv.getHeight(); ++i)
    {
        for (int j = 0; j < inv.getWidth(); ++j)
        {
            ItemStack itemstack = inv.getStackInRowAndColumn(j, i);

            if (!itemstack.func_190926_b())
            {
                boolean flag = false;

                for (ItemStack itemstack1 : list)
                {
                    if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getMetadata() == 32767 || itemstack.getMetadata() == itemstack1.getMetadata()))
                    {
                        flag = true;
                        list.remove(itemstack1);
                        break;
                    }
                }

                if (!flag)
                {
                    return false;
                }
            }
        }
    }

    return list.isEmpty();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:38,代码来源:ShapelessRecipes.java

示例9: func_191420_l

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean func_191420_l()
{
    for (ItemStack itemstack : this.inventoryContents)
    {
        if (!itemstack.func_190926_b())
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:InventoryBasic.java

示例10: matches

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

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

        if (!itemstack.func_190926_b())
        {
            if (Block.getBlockFromItem(itemstack.getItem()) instanceof BlockShulkerBox)
            {
                ++i;
            }
            else
            {
                if (itemstack.getItem() != Items.DYE)
                {
                    return false;
                }

                ++j;
            }

            if (j > 1 || i > 1)
            {
                return false;
            }
        }
    }

    return i == 1 && j == 1;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:35,代码来源:ShulkerBoxRecipes.java

示例11: matches

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    if (inv.getWidth() == 3 && inv.getHeight() == 3)
    {
        for (int i = 0; i < inv.getWidth(); ++i)
        {
            for (int j = 0; j < inv.getHeight(); ++j)
            {
                ItemStack itemstack = inv.getStackInRowAndColumn(i, j);

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

                Item item = itemstack.getItem();

                if (i == 1 && j == 1)
                {
                    if (item != Items.LINGERING_POTION)
                    {
                        return false;
                    }
                }
                else if (item != Items.ARROW)
                {
                    return false;
                }
            }
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:RecipeTippedArrow.java

示例12: onLivingUpdate

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
 * use this to react to sunlight and start to burn.
 */
public void onLivingUpdate()
{
    if (this.world.isDaytime() && !this.world.isRemote)
    {
        float f = this.getBrightness(1.0F);
        BlockPos blockpos = this.getRidingEntity() instanceof EntityBoat ? (new BlockPos(this.posX, (double)Math.round(this.posY), this.posZ)).up() : new BlockPos(this.posX, (double)Math.round(this.posY), this.posZ);

        if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canSeeSky(blockpos))
        {
            boolean flag = true;
            ItemStack itemstack = this.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

            if (!itemstack.func_190926_b())
            {
                if (itemstack.isItemStackDamageable())
                {
                    itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2));

                    if (itemstack.getItemDamage() >= itemstack.getMaxDamage())
                    {
                        this.renderBrokenItemStack(itemstack);
                        this.setItemStackToSlot(EntityEquipmentSlot.HEAD, ItemStack.field_190927_a);
                    }
                }

                flag = false;
            }

            if (flag)
            {
                this.setFire(8);
            }
        }
    }

    super.onLivingUpdate();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:AbstractSkeleton.java

示例13: matches

import net.minecraft.item.ItemStack; //导入方法依赖的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.func_190926_b())
        {
            list.add(itemstack);

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

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

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

示例14: dropItem

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
@Nullable
public EntityItem dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem)
{
    if (droppedItem.func_190926_b())
    {
        return null;
    }
    else
    {
        double d0 = this.posY - 0.30000001192092896D + (double)this.getEyeHeight();
        EntityItem entityitem = new EntityItem(this.world, this.posX, d0, this.posZ, droppedItem);
        entityitem.setPickupDelay(40);

        if (traceItem)
        {
            entityitem.setThrower(this.getName());
        }

        if (dropAround)
        {
            float f = this.rand.nextFloat() * 0.5F;
            float f1 = this.rand.nextFloat() * ((float)Math.PI * 2F);
            entityitem.motionX = (double)(-MathHelper.sin(f1) * f);
            entityitem.motionZ = (double)(MathHelper.cos(f1) * f);
            entityitem.motionY = 0.20000000298023224D;
        }
        else
        {
            float f2 = 0.3F;
            entityitem.motionX = (double)(-MathHelper.sin(this.rotationYaw * 0.017453292F) * MathHelper.cos(this.rotationPitch * 0.017453292F) * f2);
            entityitem.motionZ = (double)(MathHelper.cos(this.rotationYaw * 0.017453292F) * MathHelper.cos(this.rotationPitch * 0.017453292F) * f2);
            entityitem.motionY = (double)(-MathHelper.sin(this.rotationPitch * 0.017453292F) * f2 + 0.1F);
            float f3 = this.rand.nextFloat() * ((float)Math.PI * 2F);
            f2 = 0.02F * this.rand.nextFloat();
            entityitem.motionX += Math.cos((double)f3) * (double)f2;
            entityitem.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
            entityitem.motionZ += Math.sin((double)f3) * (double)f2;
        }

        ItemStack itemstack = this.dropItemAndGetStack(entityitem);

        if (traceItem)
        {
            if (!itemstack.func_190926_b())
            {
                this.addStat(StatList.getDroppedObjectStats(itemstack.getItem()), droppedItem.func_190916_E());
            }

            this.addStat(StatList.DROP);
        }

        return entityitem;
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:55,代码来源:EntityPlayer.java

示例15: SPacketSetSlot

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public SPacketSetSlot(int windowIdIn, int slotIn, ItemStack itemIn)
{
    this.windowId = windowIdIn;
    this.slot = slotIn;
    this.item = itemIn.func_190926_b() ? ItemStack.field_190927_a : itemIn.copy();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:SPacketSetSlot.java


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