public new static void DelWater(int l) { int num = QuickLiquidV2.liquid2[l].x; int num2 = QuickLiquidV2.liquid2[l].y; Tile tile = Main.tile[num - 1, num2]; Tile tile2 = Main.tile[num + 1, num2]; Tile tile3 = Main.tile[num, num2 + 1]; Tile tile4 = Main.tile[num, num2]; byte b = 2; if (tile4.liquid < b) { tile4.liquid = 0; if (tile.liquid < b) { tile.liquid = 0; } else { Liquid2.AddWater(num - 1, num2); } if (tile2.liquid < b) { tile2.liquid = 0; } else { Liquid2.AddWater(num + 1, num2); } } else if (tile4.liquid < 20) { if ((tile.liquid < tile4.liquid && (!tile.nactive() || !Main.tileSolid[(int)tile.type] || Main.tileSolidTop[(int)tile.type])) || (tile2.liquid < tile4.liquid && (!tile2.nactive() || !Main.tileSolid[(int)tile2.type] || Main.tileSolidTop[(int)tile2.type])) || (tile3.liquid < 255 && (!tile3.nactive() || !Main.tileSolid[(int)tile3.type] || Main.tileSolidTop[(int)tile3.type]))) { tile4.liquid = 0; } } else if (tile3.liquid < 255 && (!tile3.nactive() || !Main.tileSolid[(int)tile3.type] || Main.tileSolidTop[(int)tile3.type]) && !Liquid.stuck) { QuickLiquidV2.liquid2[l].kill = 0; return; } if (tile4.liquid < 250 && Main.tile[num, num2 - 1].liquid > 0) { Liquid2.AddWater(num, num2 - 1); } if (tile4.liquid == 0) { tile4.liquidType(0); } else { if ((tile2.liquid > 0 && Main.tile[num + 1, num2 + 1].liquid < 250 && !Main.tile[num + 1, num2 + 1].active()) || (tile.liquid > 0 && Main.tile[num - 1, num2 + 1].liquid < 250 && !Main.tile[num - 1, num2 + 1].active())) { Liquid2.AddWater(num - 1, num2); Liquid2.AddWater(num + 1, num2); } if (tile4.lava()) { Liquid2.LavaCheck(num, num2); for (int i = num - 1; i <= num + 1; i++) { for (int j = num2 - 1; j <= num2 + 1; j++) { Tile tile5 = Main.tile[i, j]; if (tile5.active()) { if (tile5.type == 2 || tile5.type == 23 || tile5.type == 109 || tile5.type == 199) { tile5.type = 0; Terraria.WorldGen.SquareTileFrame(i, j, true); if (Main.netMode == 2) { NetMessage.SendTileSquare(-1, num, num2, 3, TileChangeType.None); } } else if (tile5.type == 60 || tile5.type == 70) { tile5.type = 59; Terraria.WorldGen.SquareTileFrame(i, j, true); if (Main.netMode == 2) { NetMessage.SendTileSquare(-1, num, num2, 3, TileChangeType.None); } } } } } } else if (tile4.honey()) { Liquid2.HoneyCheck(num, num2); } } if (Main.netMode == 2) { Liquid2.NetSendLiquid(num, num2); } Liquid2.numLiquid--; Main.tile[QuickLiquidV2.liquid2[l].x, QuickLiquidV2.liquid2[l].y].checkingLiquid(false); QuickLiquidV2.liquid2[l].x = QuickLiquidV2.liquid2[Liquid2.numLiquid].x; QuickLiquidV2.liquid2[l].y = QuickLiquidV2.liquid2[Liquid2.numLiquid].y; QuickLiquidV2.liquid2[l].kill = QuickLiquidV2.liquid2[Liquid2.numLiquid].kill; if (Main.tileAlch[(int)tile4.type]) { Terraria.WorldGen.CheckAlch(num, num2); } }
public new static void AddWater(int x, int y) { Tile tile = Main.tile[x, y]; if (Main.tile[x, y] == null) { return; } if (tile.checkingLiquid()) { return; } if (x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5) { return; } if (x < 5 || y < 5) { return; } if (tile.liquid == 0) { return; } if (Liquid2.numLiquid >= Liquid2.maxLiquid - 1) { LiquidBuffer.AddBuffer(x, y); return; } tile.checkingLiquid(true); QuickLiquidV2.liquid2[Liquid2.numLiquid].kill = 0; QuickLiquidV2.liquid2[Liquid2.numLiquid].x = x; QuickLiquidV2.liquid2[Liquid2.numLiquid].y = y; QuickLiquidV2.liquid2[Liquid2.numLiquid].delay = 0; tile.skipLiquid(false); Liquid2.numLiquid++; if (Main.netMode == 2) { Liquid2.NetSendLiquid(x, y); } if (tile.active() && !Terraria.WorldGen.gen) { bool flag = false; if (tile.lava()) { if (TileObjectData.CheckLavaDeath(tile)) { flag = true; } } else if (TileObjectData.CheckWaterDeath(tile)) { flag = true; } if (flag) { Terraria.WorldGen.KillTile(x, y, false, false, false); if (Main.netMode == 2) { NetMessage.SendData(17, -1, -1, null, 0, (float)x, (float)y, 0f, 0, 0, 0); } } } }