コード例 #1
0
ファイル: BlockSlab.cs プロジェクト: kennyzhong/VoxelEngine
 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
ファイル: BlockSlab.cs プロジェクト: kennyzhong/VoxelEngine
 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
ファイル: BlockSlab.cs プロジェクト: kennyzhong/VoxelEngine
 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()));
 }