Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ CanUnderwaterPlantGrowHere()

static bool Terraria.WorldGen.CanUnderwaterPlantGrowHere ( ushort type,
int x,
int y,
bool ignoreSelf )
inlinestatic

Definition at line 49472 of file WorldGen.cs.

49473 {
49474 if (!InWorld(x, y, 50))
49475 {
49476 return false;
49477 }
49478 Tile tileSafely = Framing.GetTileSafely(x, y);
49479 if (!ignoreSelf && tileSafely.active())
49480 {
49481 return false;
49482 }
49483 for (int i = 0; i < 3; i++)
49484 {
49485 tileSafely = Framing.GetTileSafely(x, y - i);
49486 if (tileSafely.liquid == 0 || tileSafely.liquidType() != 0)
49487 {
49488 return false;
49489 }
49490 }
49491 Tile tileSafely2 = Framing.GetTileSafely(x, y + 1);
49492 if (!tileSafely2.nactive())
49493 {
49494 return false;
49495 }
49496 if (!TileID.Sets.Conversion.Sand[tileSafely2.type] && type != tileSafely2.type)
49497 {
49498 return false;
49499 }
49500 tileSafely = Framing.GetTileSafely(x, y);
49501 ushort wall = tileSafely.wall;
49502 if (wall != 0 && (uint)(wall - 63) > 6u && (uint)(wall - 80) > 1u)
49503 {
49504 return false;
49505 }
49506 return true;
49507 }
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:5816

References Terraria.Framing.GetTileSafely(), Terraria.ID.TileID.Sets.Conversion.Sand, and System.type.