示例#1
0
 public override bool onRightClick(World world, EntityPlayer player, ItemStack heldStack, BlockPos pos, int meta, Direction clickedFace, Vector3 clickedPos)
 {
     if (heldStack != null && heldStack.item.id == this.id && !BlockSlab.isFull(meta) && BlockSlab.getDirectionFromMeta(meta) == clickedFace.getOpposite())
     {
         world.setBlock(pos, this, 6);
         player.reduceHeldStackByOne();
         return(true);
     }
     return(false);
 }
示例#2
0
 public override ItemStack[] getDrops(World world, BlockPos pos, int meta, ItemTool brokenWith)
 {
     return(new ItemStack [] { new ItemStack(this.asItem(), 0, BlockSlab.isFull(meta) ? 2 : 1) });
 }
示例#3
0
 public override int adjustMetaOnPlace(World world, BlockPos pos, int meta, Direction clickedDirNormal, Vector3 angle)
 {
     // Note, as this is called by ItemBlock, this method isn't called when a second slab is added to the same spot.
     return(BlockSlab.getMetaFromDirection(clickedDirNormal.getOpposite()));
 }