本文整理汇总了Java中net.minecraft.tileentity.TileEntityFlowerPot.func_145964_a方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityFlowerPot.func_145964_a方法的具体用法?Java TileEntityFlowerPot.func_145964_a怎么用?Java TileEntityFlowerPot.func_145964_a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntityFlowerPot
的用法示例。
在下文中一共展示了TileEntityFlowerPot.func_145964_a方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockHarvested
import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
/**
* Called when the block is attempted to be harvested
*/
public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
{
super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
if (p_149681_6_.capabilities.isCreativeMode)
{
TileEntityFlowerPot var7 = this.func_149929_e(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_);
if (var7 != null)
{
var7.func_145964_a(Item.getItemById(0), 0);
}
}
}
示例2: onBlockHarvested
import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
{
super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
if (p_149681_6_.capabilities.isCreativeMode)
{
TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_);
if (tileentityflowerpot != null)
{
tileentityflowerpot.func_145964_a(Item.getItemById(0), 0);
}
}
}
示例3: generatePotContents
import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public static void generatePotContents(Random rand, TileEntityFlowerPot te) {
int[] possibleContents = {6, 32, 37, 38, 39, 40, 81}; //{"minecraft:sapling", "minecraft:deadbush", "minecraft:yellow_flower", "minecraft:red_flower", "minecraft:brown_mushroom", "minecraft:red_mushroom", "minecraft:cactus"}
int[][] possibleMeta = {{0, 1, 2, 3, 4, 5}, {0}, {0}, {0, 1, 2, 3, 4, 5, 6, 7, 8}, {0}, {0}, {0}};
int contentIndex = rand.nextInt(possibleContents.length);
int metaIndex = rand.nextInt(possibleMeta[contentIndex].length);
te.func_145964_a(Item.getItemById(possibleContents[contentIndex]), possibleMeta[contentIndex][metaIndex]);
}
示例4: onBlockActivated
import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
/**
* Called upon block activation (right click on the block.)
*/
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 var10 = p_149727_5_.inventory.getCurrentItem();
if (var10 != null && var10.getItem() instanceof ItemBlock)
{
if (p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_) != 0)
{
return false;
}
else
{
TileEntityFlowerPot var11 = this.func_149929_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);
if (var11 != null)
{
Block var12 = Block.getBlockFromItem(var10.getItem());
if (!this.func_149928_a(var12, var10.getItemDamage()))
{
return false;
}
else
{
var11.func_145964_a(var10.getItem(), var10.getItemDamage());
var11.onInventoryChanged();
if (!p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var10.getItemDamage(), 2))
{
p_149727_1_.func_147471_g(p_149727_2_, p_149727_3_, p_149727_4_);
}
if (!p_149727_5_.capabilities.isCreativeMode && --var10.stackSize <= 0)
{
p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, (ItemStack)null);
}
return true;
}
}
else
{
return false;
}
}
}
else
{
return false;
}
}
示例5: 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;
}
}