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


Java TileEntityFlowerPot.getFlowerPotItem方法代码示例

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


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

示例1: breakBlock

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

    if (tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null)
    {
        spawnAsEntity(worldIn, pos, new ItemStack(tileentityflowerpot.getFlowerPotItem(), 1, tileentityflowerpot.getFlowerPotData()));
    }

    super.breakBlock(worldIn, pos, state);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:BlockFlowerPot.java

示例2: breakBlock

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
/**
 * Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
 */
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
    TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);

    if (tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null)
    {
        spawnAsEntity(worldIn, pos, new ItemStack(tileentityflowerpot.getFlowerPotItem(), 1, tileentityflowerpot.getFlowerPotData()));
    }

    super.breakBlock(worldIn, pos, state);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:BlockFlowerPot.java

示例3: getDrops

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@Override
public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
    java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
    TileEntityFlowerPot te = world.getTileEntity(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.getTileEntity(pos) : null;
    if (te != null && te.getFlowerPotItem() != null)
        ret.add(new ItemStack(te.getFlowerPotItem(), 1, te.getFlowerPotData()));
    return ret;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:BlockFlowerPot.java

示例4: getItem

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public Item getItem(World worldIn, BlockPos pos)
{
	TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
	return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ?
		       tileentityflowerpot.getFlowerPotItem() :
		       Item.getItemFromBlock(MBlocks.ministrapp_flower_pot);
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:10,代码来源:MBlockSketchyBackwaterFlowerpot.java

示例5: getDamageValue

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@Override
public int getDamageValue(World worldIn, BlockPos pos)
{
	TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
	return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ?
		       tileentityflowerpot.getFlowerPotData() :
		       0;
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:9,代码来源:MBlockSketchyBackwaterFlowerpot.java

示例6: getDrops

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@Override
public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
	java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
	TileEntityFlowerPot te = world.getTileEntity(pos) instanceof TileEntityFlowerPot ?
		                         (TileEntityFlowerPot) world.getTileEntity(pos) :
		                         null;
	if (te != null && te.getFlowerPotItem() != null)
		ret.add(new ItemStack(te.getFlowerPotItem(), 1, te.getFlowerPotData()));
	return ret;
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:12,代码来源:MBlockSketchyBackwaterFlowerpot.java

示例7: getContents

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@ScriptCallable(returnTypes = ReturnType.TABLE)
public ItemStack getContents(TileEntityFlowerPot pot) {
	Item item = pot.getFlowerPotItem();

	if (item == null) return null;
	int data = pot.getFlowerPotData();
	return new ItemStack(item, 1, data);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:9,代码来源:AdapterFlowerPot.java

示例8: getDrops

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
{
    ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
    TileEntityFlowerPot te = this.func_149929_e(world, x, y, z);
    if (te != null && te.getFlowerPotItem() != null)
        ret.add(new ItemStack(te.getFlowerPotItem(), 1, te.getFlowerPotData()));
    return ret;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:10,代码来源:BlockFlowerPot.java

示例9: onBlockActivated

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    ItemStack itemstack = playerIn.inventory.getCurrentItem();

    if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
    {
        TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);

        if (tileentityflowerpot == null)
        {
            return false;
        }
        else if (tileentityflowerpot.getFlowerPotItem() != null)
        {
            return false;
        }
        else
        {
            Block block = Block.getBlockFromItem(itemstack.getItem());

            if (!this.canNotContain(block, itemstack.getMetadata()))
            {
                return false;
            }
            else
            {
                tileentityflowerpot.setFlowerPotData(itemstack.getItem(), itemstack.getMetadata());
                tileentityflowerpot.markDirty();
                worldIn.markBlockForUpdate(pos);
                playerIn.triggerAchievement(StatList.field_181736_T);

                if (!playerIn.capabilities.isCreativeMode && --itemstack.stackSize <= 0)
                {
                    playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null);
                }

                return true;
            }
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:46,代码来源:BlockFlowerPot.java

示例10: getDamageValue

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public int getDamageValue(World worldIn, BlockPos pos)
{
    TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
    return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotData() : 0;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:BlockFlowerPot.java

示例11: getItem

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public Item getItem(World worldIn, BlockPos pos)
{
    TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
    return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotItem() : Items.flower_pot;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:BlockFlowerPot.java

示例12: onBlockActivated

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (heldItem != null && heldItem.getItem() instanceof ItemBlock)
    {
        TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);

        if (tileentityflowerpot == null)
        {
            return false;
        }
        else if (tileentityflowerpot.getFlowerPotItem() != null)
        {
            return false;
        }
        else
        {
            Block block = Block.getBlockFromItem(heldItem.getItem());

            if (!this.canContain(block, heldItem.getMetadata()))
            {
                return false;
            }
            else
            {
                tileentityflowerpot.setFlowerPotData(heldItem.getItem(), heldItem.getMetadata());
                tileentityflowerpot.markDirty();
                worldIn.notifyBlockUpdate(pos, state, state, 3);
                playerIn.addStat(StatList.FLOWER_POTTED);

                if (!playerIn.capabilities.isCreativeMode)
                {
                    --heldItem.stackSize;
                }

                return true;
            }
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:BlockFlowerPot.java

示例13: onBlockActivated

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
	ItemStack itemstack = playerIn.inventory.getCurrentItem();

	if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
	{
		TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);

		if (tileentityflowerpot == null)
		{
			return false;
		}
		else if (tileentityflowerpot.getFlowerPotItem() != null)
		{
			return false;
		}
		else
		{
			Block block = Block.getBlockFromItem(itemstack.getItem());

			if (!this.canNotContain(block, itemstack.getMetadata()))
			{
				return false;
			}
			else
			{
				tileentityflowerpot.setFlowerPotData(itemstack.getItem(), itemstack.getMetadata());
				tileentityflowerpot.markDirty();
				worldIn.markBlockForUpdate(pos);

				if (!playerIn.capabilities.isCreativeMode && --itemstack.stackSize <= 0)
				{
					playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, null);
				}

				return true;
			}
		}
	}
	else
	{
		return false;
	}
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:46,代码来源:MBlockSketchyBackwaterFlowerpot.java

示例14: onBlockActivated

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    ItemStack itemstack = p_149727_5_.inventory.getCurrentItem();

    if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
    {
        TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);

        if (tileentityflowerpot != null)
        {
            if (tileentityflowerpot.getFlowerPotItem() != null)
            {
                return false;
            }
            else
            {
                Block block = Block.getBlockFromItem(itemstack.getItem());

                if (!this.func_149928_a(block, itemstack.getItemDamage()))
                {
                    return false;
                }
                else
                {
                    tileentityflowerpot.func_145964_a(itemstack.getItem(), itemstack.getItemDamage());
                    tileentityflowerpot.markDirty();

                    if (!p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, itemstack.getItemDamage(), 2))
                    {
                        p_149727_1_.markBlockForUpdate(p_149727_2_, p_149727_3_, p_149727_4_);
                    }

                    if (!p_149727_5_.capabilities.isCreativeMode && --itemstack.stackSize <= 0)
                    {
                        p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, (ItemStack)null);
                    }

                    return true;
                }
            }
        }
        else
        {
            return false;
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:52,代码来源:BlockFlowerPot.java

示例15: getItem

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{
    TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149694_1_, p_149694_2_, p_149694_3_, p_149694_4_);
    return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotItem() : Items.flower_pot;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:7,代码来源:BlockFlowerPot.java


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