本文整理匯總了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();
}
}