Пример #1
0
        public void LavaFlow(int x, int y, int z, byte meta)
        {
            byte block = w.GetBlock(x, y, z);
            byte bMeta = w.GetMeta(x, y, z);

            if (block == 0 || block == 51 || ((block == 10 || block == 11) && (meta & 0x7) < bMeta && (bMeta & 0x8) == 0))
            {
                AddUpdate(x, y, z, 10, meta);
                if (block == 51)
                {
                    Player.GlobalSoundEffect(x, (byte)y, z, 1004, w);
                }
            }
            else if (BlockData.LiquidDestroy(block))
            {
                AddUpdate(x, y, z, 10, meta);
                Player.GlobalSoundEffect(x, (byte)y, z, 2000, 4, w);

                short dropId = Player.BlockDropSwitch(block);
                if (FindBlocks.ValidItem(dropId))
                {
                    w.DropItem(x, y, z, dropId);
                }
            }
        }
Пример #2
0
        public void WaterFlow(int x, int y, int z, byte meta)
        {
            if (SpongeCheck(x, y, z))
            {
                return;
            }
            byte block = w.GetBlock(x, y, z);
            byte bMeta = w.GetMeta(x, y, z);

            if (block == 0 || block == 51 || ((block == 8 || block == 9) && (meta & 0x7) < bMeta && (bMeta & 0x8) == 0))
            {
                AddUpdate(x, y, z, 8, meta);
                if (block == 51)
                {
                    Player.GlobalSoundEffect(x, (byte)y, z, 1004, w);
                }
            }
            else if (BlockData.LiquidDestroy(block))
            {
                AddUpdate(x, y, z, 8, meta);

                short dropId = Player.BlockDropSwitch(block);
                if (FindBlocks.ValidItem(dropId))
                {
                    w.DropItem(x, y, z, dropId);
                }
            }
            else if (block == 10 || block == 11)
            {
                if ((bMeta & 0x8) != 0)
                {
                    return;
                }
                if ((bMeta & 0x7) == 0)
                {
                    AddUpdate(x, y, z, 49, 0);
                }
                else
                {
                    AddUpdate(x, y, z, 4, 0);
                }
                Player.GlobalSoundEffect(x, (byte)y, z, 1004, w);
                //Player.GlobalSoundEffect(x, (byte)y, z, 2000, 4, w);
            }
        }