36899    {
36900        if (Main.tile[x, y] == null)
36901        {
36902            Main.tile[x, y] = 
new Tile();
 
36903        }
36904        if (Main.tile[x, y + 1] == null)
36905        {
36906            Main.tile[x, y + 1] = 
new Tile();
 
36907        }
36908        bool flag = false;
36909        if (!Main.tile[x, y + 1].nactive())
36910        {
36911            flag = true;
36912        }
36913        if (Main.tile[x, y + 1].halfBrick())
36914        {
36915            flag = true;
36916        }
36917        int num = Main.tile[x, y].frameX / 18;
36918        Main.tile[x, y].frameY = 0;
36919        if (!flag)
36920        {
36921            switch (num)
36922            {
36923            case 0:
36924                if (Main.tile[x, y + 1].type != 109 && Main.tile[x, y + 1].type != 2 && Main.tile[x, y + 1].type != 477 && Main.tile[x, y + 1].type != 492 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36925                {
36926                    flag = true;
36927                }
36928                if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36929                {
36930                    flag = true;
36931                }
36932                break;
36933            case 1:
36934                if (Main.tile[x, y + 1].type != 60 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36935                {
36936                    flag = true;
36937                }
36938                if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36939                {
36940                    flag = true;
36941                }
36942                break;
36943            case 2:
36944                if (Main.tile[x, y + 1].type != 0 && Main.tile[x, y + 1].type != 59 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36945                {
36946                    flag = true;
36947                }
36948                if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36949                {
36950                    flag = true;
36951                }
36952                break;
36953            case 3:
36954                if (Main.tile[x, y + 1].type != 661 && Main.tile[x, y + 1].type != 662 && Main.tile[x, y + 1].type != 199 && Main.tile[x, y + 1].type != 203 && Main.tile[x, y + 1].type != 23 && Main.tile[x, y + 1].type != 25 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36955                {
36956                    flag = true;
36957                }
36958                if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36959                {
36960                    flag = true;
36961                }
36962                break;
36963            case 4:
36964                if (Main.tile[x, y + 1].type != 53 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380 && Main.tile[x, y + 1].type != 116)
36965                {
36966                    flag = true;
36967                }
36968                if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36969                {
36970                    flag = true;
36971                }
36972                break;
36973            case 5:
36974                if (Main.tile[x, y + 1].type != 57 && Main.tile[x, y + 1].type != 633 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36975                {
36976                    flag = true;
36977                }
36978                if (Main.tile[x, y].type == 82 || !Main.tile[x, y].lava() || Main.netMode == 1)
36979                {
36980                    break;
36981                }
36982                if (Main.tile[x, y].liquid > 16)
36983                {
36984                    if (Main.tile[x, y].type == 83)
36985                    {
36986                        Main.tile[x, y].type = 84;
36987                        if (Main.netMode == 2)
36988                        {
36989                            NetMessage.SendTileSquare(-1, x, y);
36990                        }
36991                    }
36992                }
36993                else if (Main.tile[x, y].type == 84)
36994                {
36995                    Main.tile[x, y].type = 83;
36996                    if (Main.netMode == 2)
36997                    {
36998                        NetMessage.SendTileSquare(-1, x, y);
36999                    }
37000                }
37001                break;
37002            case 6:
37003                if (Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380 && Main.tile[x, y + 1].type != 147 && Main.tile[x, y + 1].type != 161 && Main.tile[x, y + 1].type != 163 && Main.tile[x, y + 1].type != 164 && Main.tile[x, y + 1].type != 200)
37004                {
37005                    flag = true;
37006                }
37007                if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
37008                {
37009                    flag = true;
37010                }
37011                break;
37012            }
37013        }
37014        if (flag)
37015        {
37017        }
37018    }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)