Ejemplo n.º 1
0
        public override void PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
        {
            if (Metadata == 8 || Metadata == 10)             //Prevent some kind of cheating...
            {
                var itemBlock = new ItemBlock(BlockFactory.GetBlockById((byte)Metadata));
                itemBlock.PlaceBlock(world, player, blockCoordinates, face, faceCoords);
            }
            else if (Metadata == 0)             // Empty bucket
            {
                // Pick up water/lava
                var block = world.GetBlock(blockCoordinates);
                switch (block)
                {
                case Stationary fluid:
                {
                    if (fluid.LiquidDepth == 0)                             // Only source blocks
                    {
                        world.SetAir(blockCoordinates);
                    }
                    break;
                }

                case Flowing fluid:
                {
                    if (fluid.LiquidDepth == 0)                             // Only source blocks
                    {
                        world.SetAir(blockCoordinates);
                    }
                    break;
                }
                }
            }

            FuelEfficiency = (short)(Metadata == 10 ? 1000 : 0);
        }
Ejemplo n.º 2
0
        public override void PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
        {
            ItemBlock itemBlock = new ItemBlock(BlockFactory.GetBlockById(141));

            itemBlock.PlaceBlock(world, player, blockCoordinates, face, faceCoords);
        }