本文整理汇总了Java中net.minecraft.tileentity.TileEntityFlowerPot类的典型用法代码示例。如果您正苦于以下问题:Java TileEntityFlowerPot类的具体用法?Java TileEntityFlowerPot怎么用?Java TileEntityFlowerPot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileEntityFlowerPot类属于net.minecraft.tileentity包,在下文中一共展示了TileEntityFlowerPot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: colorMultiplier
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityFlowerPot)
{
Item item = ((TileEntityFlowerPot)tileentity).getFlowerPotItem();
if (item instanceof ItemBlock)
{
return Block.getBlockFromItem(item).colorMultiplier(worldIn, pos, renderPass);
}
}
return 16777215;
}
示例2: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
/**
* Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
* beacons, skulls, flowerpot
*/
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
int i = packetIn.getTileEntityType();
if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
}
}
}
示例3: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
/**
* Updates the NBTTagCompound metadata of instances of the following
* entitytypes: Mob spawners, command blocks, beacons, skulls, flowerpot
*/
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
int i = packetIn.getTileEntityType();
if (i == 1 && tileentity instanceof TileEntityMobSpawner
|| i == 2 && tileentity instanceof TileEntityCommandBlock
|| i == 3 && tileentity instanceof TileEntityBeacon
|| i == 4 && tileentity instanceof TileEntitySkull
|| i == 5 && tileentity instanceof TileEntityFlowerPot
|| i == 6 && tileentity instanceof TileEntityBanner) {
tileentity.readFromNBT(packetIn.getNbtCompound());
}
}
}
示例4: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
/**
* Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
* beacons, skulls, flowerpot
*/
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
int i = packetIn.getTileEntityType();
boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;
if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
}
if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
{
((GuiCommandBlock)this.gameController.currentScreen).updateGui();
}
}
}
示例5: getItem
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的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);
}
示例6: getItem
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的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 != null)
{
return itemstack;
}
}
return new ItemStack(Items.FLOWER_POT);
}
示例7: onReceiveClient
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
@Override
public void onReceiveClient(Minecraft client, WorldClient world, EntityPlayerSP player, MessageContext context) {
BlockSystem blockSystem = BlockSystems.PROXY.getBlockSystemHandler(world).getBlockSystem(this.blockSystem);
if (blockSystem != null) {
if (blockSystem.isBlockLoaded(this.pos)) {
TileEntity blockEntity = blockSystem.getTileEntity(this.pos);
boolean commandBlock = this.type == 2 && blockEntity instanceof TileEntityCommandBlock;
if (this.type == 1 && blockEntity instanceof TileEntityMobSpawner || commandBlock || this.type == 3 && blockEntity instanceof TileEntityBeacon || this.type == 4 && blockEntity instanceof TileEntitySkull || this.type == 5 && blockEntity instanceof TileEntityFlowerPot || this.type == 6 && blockEntity instanceof TileEntityBanner || this.type == 7 && blockEntity instanceof TileEntityStructure || this.type == 8 && blockEntity instanceof TileEntityEndGateway || this.type == 9 && blockEntity instanceof TileEntitySign) {
blockEntity.readFromNBT(this.data);
} else {
blockEntity.onDataPacket(client.getConnection().getNetworkManager(), new SPacketUpdateTileEntity(this.pos, this.type, this.data));
}
if (commandBlock && client.currentScreen instanceof GuiCommandBlock) {
((GuiCommandBlock) client.currentScreen).updateGui();
}
}
}
}
示例8: colorMultiplier
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityFlowerPot)
{
Item item = ((TileEntityFlowerPot) tileentity).getFlowerPotItem();
if (item instanceof ItemBlock)
{
return Block.getBlockFromItem(item).colorMultiplier(worldIn, pos, renderPass);
}
}
return 16777215;
}
示例9: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
/**
* Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
* beacons, skulls, flowerpot
*/
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
int i = packetIn.getTileEntityType();
boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;
if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
}
else
{
tileentity.onDataPacket(netManager, packetIn);
}
if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
{
((GuiCommandBlock)this.gameController.currentScreen).updateGui();
}
}
}
示例10: 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);
}
示例11: onBlockHarvested
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
{
super.onBlockHarvested(worldIn, pos, state, player);
if (player.capabilities.isCreativeMode)
{
TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
if (tileentityflowerpot != null)
{
tileentityflowerpot.setFlowerPotData((Item)null, 0);
}
}
}
示例12: 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);
}
示例13: onBlockHarvested
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
{
super.onBlockHarvested(worldIn, pos, state, player);
if (player.capabilities.isCreativeMode)
{
TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
if (tileentityflowerpot != null)
{
tileentityflowerpot.func_190614_a(ItemStack.field_190927_a);
}
}
}
示例14: 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;
}
示例15: handleUpdateTileEntity
import net.minecraft.tileentity.TileEntityFlowerPot; //导入依赖的package包/类
/**
* Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
* beacons, skulls, flowerpot
*/
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
int i = packetIn.getTileEntityType();
boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;
if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
}
else
{
if(tileentity == null)
{
LOGGER.error("Received invalid update packet for null tile entity at {} with data: {}", packetIn.getPos(), packetIn.getNbtCompound());
return;
}
tileentity.onDataPacket(netManager, packetIn);
}
if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
{
((GuiCommandBlock)this.gameController.currentScreen).updateGui();
}
}
}