本文整理汇总了Java中net.minecraft.block.BlockLog.func_150165_c方法的典型用法代码示例。如果您正苦于以下问题:Java BlockLog.func_150165_c方法的具体用法?Java BlockLog.func_150165_c怎么用?Java BlockLog.func_150165_c使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.BlockLog
的用法示例。
在下文中一共展示了BlockLog.func_150165_c方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemUse
import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else
{
if (par1ItemStack.getItemDamage() == 15)
{
if (func_150919_a(par1ItemStack, par3World, par4, par5, par6))
{
if (!par3World.isClient)
{
par3World.playAuxSFX(2005, par4, par5, par6, 0);
}
return true;
}
}
else if (par1ItemStack.getItemDamage() == 3)
{
Block var11 = par3World.getBlock(par4, par5, par6);
int var12 = par3World.getBlockMetadata(par4, par5, par6);
if (var11 == Blocks.log && BlockLog.func_150165_c(var12) == 3)
{
if (par7 == 0)
{
return false;
}
if (par7 == 1)
{
return false;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
if (par3World.isAirBlock(par4, par5, par6))
{
int var13 = Blocks.cocoa.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0);
par3World.setBlock(par4, par5, par6, Blocks.cocoa, var13, 2);
if (!par2EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
}
return true;
}
}
return false;
}
}
示例2: onItemUse
import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
Block block = world.getBlock(p_77648_4_, p_77648_5_, p_77648_6_);
int i1 = world.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_);
if (block == Blocks.log && BlockLog.func_150165_c(i1) == 3)
{
if (p_77648_7_ == 0)
{
return false;
}
if (p_77648_7_ == 1)
{
return false;
}
if (p_77648_7_ == 2)
{
--p_77648_6_;
}
if (p_77648_7_ == 3)
{
++p_77648_6_;
}
if (p_77648_7_ == 4)
{
--p_77648_4_;
}
if (p_77648_7_ == 5)
{
++p_77648_4_;
}
if (world.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_))
{
int j1 = Blocks.cocoa.onBlockPlaced(world, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, 0);
world.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.cocoa, j1, 2);
if (!entityplayer.capabilities.isCreativeMode)
{
--itemstack.stackSize;
}
}
return true;
}
return false;
}
示例3: onItemUse
import net.minecraft.block.BlockLog; //导入方法依赖的package包/类
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_))
{
return false;
}
else
{
if (p_77648_1_.getItemDamage() == 15)
{
if (applyBonemeal(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_))
{
if (!p_77648_3_.isRemote)
{
p_77648_3_.playAuxSFX(2005, p_77648_4_, p_77648_5_, p_77648_6_, 0);
}
return true;
}
}
else if (p_77648_1_.getItemDamage() == 3)
{
Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_);
int i1 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_);
if (block == Blocks.log && BlockLog.func_150165_c(i1) == 3)
{
if (p_77648_7_ == 0)
{
return false;
}
if (p_77648_7_ == 1)
{
return false;
}
if (p_77648_7_ == 2)
{
--p_77648_6_;
}
if (p_77648_7_ == 3)
{
++p_77648_6_;
}
if (p_77648_7_ == 4)
{
--p_77648_4_;
}
if (p_77648_7_ == 5)
{
++p_77648_4_;
}
if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_))
{
int j1 = Blocks.cocoa.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, 0);
p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.cocoa, j1, 2);
if (!p_77648_2_.capabilities.isCreativeMode)
{
--p_77648_1_.stackSize;
}
}
return true;
}
}
return false;
}
}