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

◆ Place3x1()

static void Terraria.WorldGen.Place3x1 ( int x,
int y,
ushort type,
int style = 0 )
inlinestatic

Definition at line 43570 of file WorldGen.cs.

43571 {
43572 if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5)
43573 {
43574 return;
43575 }
43576 bool flag = true;
43577 for (int i = x - 1; i < x + 2; i++)
43578 {
43579 if (Main.tile[i, y] == null)
43580 {
43581 Main.tile[i, y] = new Tile();
43582 }
43583 if (Main.tile[i, y].active())
43584 {
43585 flag = false;
43586 }
43587 if (Main.tile[i, y + 1] == null)
43588 {
43589 Main.tile[i, y + 1] = new Tile();
43590 }
43591 if (!SolidTile2(i, y + 1))
43592 {
43593 flag = false;
43594 }
43595 }
43596 if (flag)
43597 {
43598 short num = (short)(54 * style);
43599 Main.tile[x - 1, y].active(active: true);
43600 Main.tile[x - 1, y].frameY = 0;
43601 Main.tile[x - 1, y].frameX = num;
43602 Main.tile[x - 1, y].type = type;
43603 Main.tile[x, y].active(active: true);
43604 Main.tile[x, y].frameY = 0;
43605 Main.tile[x, y].frameX = (short)(num + 18);
43606 Main.tile[x, y].type = type;
43607 Main.tile[x + 1, y].active(active: true);
43608 Main.tile[x + 1, y].frameY = 0;
43609 Main.tile[x + 1, y].frameX = (short)(num + 36);
43610 Main.tile[x + 1, y].type = type;
43611 }
43612 }
static bool SolidTile2(Tile testTile)

References Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.