public static void AddWater(int x, int y)
{
Tile checkTile = Main.tile[x, y];
if (Main.tile[x, y] == null || checkTile.checkingLiquid() || (x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5) || (x < 5 || y < 5 || (int)checkTile.liquid == 0))
return;
if (Liquid.numLiquid >= Liquid.maxLiquid - 1)
{
LiquidBuffer.AddBuffer(x, y);
}
else
{
checkTile.checkingLiquid(true);
Main.liquid[Liquid.numLiquid].kill = 0;
Main.liquid[Liquid.numLiquid].x = x;
Main.liquid[Liquid.numLiquid].y = y;
Main.liquid[Liquid.numLiquid].delay = 0;
checkTile.skipLiquid(false);
++Liquid.numLiquid;
if (Main.netMode == 2)
Liquid.NetSendLiquid(x, y);
if (!checkTile.active() || WorldGen.gen)
return;
bool flag = false;
if (checkTile.lava())
{
if (TileObjectData.CheckLavaDeath(checkTile))
flag = true;
}
else if (TileObjectData.CheckWaterDeath(checkTile))
flag = true;
if (!flag)
return;
WorldGen.KillTile(x, y, false, false, false);
if (Main.netMode != 2)
return;
NetMessage.SendData(17, -1, -1, "", 0, (float)x, (float)y, 0.0f, 0, 0, 0);
}
}