TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ GrowCheckSeaweed()

static void Terraria.WorldGen.GrowCheckSeaweed ( int x,
int y )
inlinestatic

Definition at line 53076 of file WorldGen.cs.

53077 {
53078 int maxValue = 1;
53079 if (Main.netMode == 1)
53080 {
53081 return;
53082 }
53083 if ((Main.tile[x, y].type == 549 && Main.tile[x, y].liquid < 200) || Main.tile[x, y - 1].liquid < 200)
53084 {
53085 if (Main.tile[x, y].active() && Main.tile[x, y].type == 549 && genRand.Next(2) == 0)
53086 {
53087 KillTile(x, y);
53088 if (Main.netMode == 2)
53089 {
53090 NetMessage.SendData(17, -1, -1, null, 0, x, y);
53091 }
53092 }
53093 }
53094 else
53095 {
53096 if (Main.tile[x, y - 1].active() || Main.tile[x, y - 2].active() || genRand.Next(maxValue) != 0 || Main.tile[x, y - 2].liquid != byte.MaxValue || Main.tile[x, y - 3].liquid != byte.MaxValue)
53097 {
53098 return;
53099 }
53100 int num = 17;
53101 int num2 = 4;
53102 int num3 = 30;
53103 int num4 = 0;
53104 for (int i = x - num2; i <= x + num2; i++)
53105 {
53106 for (int j = y; j <= y + num2 * 3; j++)
53107 {
53108 if (Main.tile[i, j].active() && Main.tile[i, j].type == 549)
53109 {
53110 num4++;
53111 if (num4 > num3)
53112 {
53113 return;
53114 }
53115 }
53116 }
53117 }
53118 int k;
53119 for (k = y; !SolidTile(x, k) && k < Main.maxTilesY - 50; k++)
53120 {
53121 }
53122 if (k - y < num - genRand.Next(20))
53123 {
53124 PlaceTile(x, y - 1, 549, mute: true);
53125 if (Main.netMode == 2)
53126 {
53127 NetMessage.SendTileSquare(-1, x, y - 1);
53128 }
53129 }
53130 }
53131 }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
Definition WorldGen.cs:1455

References Terraria.Main.netMode, Terraria.NetMessage.SendData(), Terraria.NetMessage.SendTileSquare(), Terraria.Enums.SolidTile, and Terraria.Main.tile.

+ Here is the call graph for this function: