本文整理汇总了Java中net.minecraft.item.ItemStack.canEditBlocks方法的典型用法代码示例。如果您正苦于以下问题:Java ItemStack.canEditBlocks方法的具体用法?Java ItemStack.canEditBlocks怎么用?Java ItemStack.canEditBlocks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.ItemStack
的用法示例。
在下文中一共展示了ItemStack.canEditBlocks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canPlayerEdit
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean canPlayerEdit(BlockPos p_175151_1_, EnumFacing p_175151_2_, ItemStack p_175151_3_)
{
if (this.capabilities.allowEdit)
{
return true;
}
else if (p_175151_3_ == null)
{
return false;
}
else
{
BlockPos blockpos = p_175151_1_.offset(p_175151_2_.getOpposite());
Block block = this.worldObj.getBlockState(blockpos).getBlock();
return p_175151_3_.canPlaceOn(block) || p_175151_3_.canEditBlocks();
}
}
示例2: canPlayerEdit
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean canPlayerEdit(BlockPos pos, EnumFacing facing, ItemStack stack)
{
if (this.capabilities.allowEdit)
{
return true;
}
else if (stack.func_190926_b())
{
return false;
}
else
{
BlockPos blockpos = pos.offset(facing.getOpposite());
Block block = this.world.getBlockState(blockpos).getBlock();
return stack.canPlaceOn(block) || stack.canEditBlocks();
}
}
示例3: canPlayerEdit
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean canPlayerEdit(BlockPos pos, EnumFacing facing, @Nullable ItemStack stack)
{
if (this.capabilities.allowEdit)
{
return true;
}
else if (stack == null)
{
return false;
}
else
{
BlockPos blockpos = pos.offset(facing.getOpposite());
Block block = this.worldObj.getBlockState(blockpos).getBlock();
return stack.canPlaceOn(block) || stack.canEditBlocks();
}
}