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

◆ Place1x2()

static void Terraria.WorldGen.Place1x2 ( int x,
int y,
ushort type,
int style )
inlinestatic

Definition at line 39238 of file WorldGen.cs.

39239 {
39240 short frameX = 0;
39241 if (TileID.Sets.TreeSapling[type])
39242 {
39243 frameX = (short)(genRand.Next(3) * 18);
39244 }
39245 if (Main.tile[x, y - 1] == null)
39246 {
39247 Main.tile[x, y - 1] = default(Tile);
39248 }
39249 if (Main.tile[x, y + 1] == null)
39250 {
39251 Main.tile[x, y + 1] = default(Tile);
39252 }
39253 if (SolidTile2(x, y + 1) & !Main.tile[x, y - 1].active())
39254 {
39255 short num = (short)(style * 40);
39256 Main.tile[x, y - 1].active(active: true);
39257 Main.tile[x, y - 1].frameY = num;
39258 Main.tile[x, y - 1].frameX = frameX;
39259 Main.tile[x, y - 1].type = type;
39260 Main.tile[x, y].active(active: true);
39261 Main.tile[x, y].frameY = (short)(num + 18);
39262 Main.tile[x, y].frameX = frameX;
39263 Main.tile[x, y].type = type;
39264 }
39265 }
static bool[] TreeSapling
Whether or not this tile is a sapling, which can grow into a tree based on the soil it's placed on....
Definition TileID.cs:438
static UnifiedRandom genRand
Definition WorldGen.cs:1455
static bool SolidTile2(Tile testTile)

References Terraria.Main.tile, and Terraria.ID.TileID.Sets.TreeSapling.