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

◆ Place3x4()

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

Definition at line 43460 of file WorldGen.cs.

43461 {
43462 if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5)
43463 {
43464 return;
43465 }
43466 bool flag = true;
43467 for (int i = x - 1; i < x + 2; i++)
43468 {
43469 for (int j = y - 3; j < y + 1; j++)
43470 {
43471 if (Main.tile[i, j] == null)
43472 {
43473 Main.tile[i, j] = new Tile();
43474 }
43475 if (Main.tile[i, j].active())
43476 {
43477 flag = false;
43478 }
43479 }
43480 if (Main.tile[i, y + 1] == null)
43481 {
43482 Main.tile[i, y + 1] = new Tile();
43483 }
43484 if (!SolidTile2(i, y + 1))
43485 {
43486 flag = false;
43487 }
43488 }
43489 if (flag)
43490 {
43491 int num = style * 54;
43492 for (int k = -3; k <= 0; k++)
43493 {
43494 short frameY = (short)((3 + k) * 18);
43495 Main.tile[x - 1, y + k].active(active: true);
43496 Main.tile[x - 1, y + k].frameY = frameY;
43497 Main.tile[x - 1, y + k].frameX = (short)num;
43498 Main.tile[x - 1, y + k].type = type;
43499 Main.tile[x, y + k].active(active: true);
43500 Main.tile[x, y + k].frameY = frameY;
43501 Main.tile[x, y + k].frameX = (short)(num + 18);
43502 Main.tile[x, y + k].type = type;
43503 Main.tile[x + 1, y + k].active(active: true);
43504 Main.tile[x + 1, y + k].frameY = frameY;
43505 Main.tile[x + 1, y + k].frameX = (short)(num + 36);
43506 Main.tile[x + 1, y + k].type = type;
43507 }
43508 }
43509 }
static bool SolidTile2(Tile testTile)

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