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

◆ Place5x4()

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

Definition at line 43511 of file WorldGen.cs.

43512 {
43513 if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5)
43514 {
43515 return;
43516 }
43517 bool flag = true;
43518 for (int i = x - 2; i < x + 3; i++)
43519 {
43520 for (int j = y - 3; j < y + 1; j++)
43521 {
43522 if (Main.tile[i, j] == null)
43523 {
43524 Main.tile[i, j] = new Tile();
43525 }
43526 if (Main.tile[i, j].active())
43527 {
43528 flag = false;
43529 }
43530 }
43531 if (Main.tile[i, y + 1] == null)
43532 {
43533 Main.tile[i, y + 1] = new Tile();
43534 }
43535 if (!SolidTile2(i, y + 1))
43536 {
43537 flag = false;
43538 }
43539 }
43540 if (flag)
43541 {
43542 int num = style * 54;
43543 for (int k = -3; k <= 0; k++)
43544 {
43545 short frameY = (short)((3 + k) * 18);
43546 Main.tile[x - 2, y + k].active(active: true);
43547 Main.tile[x - 2, y + k].frameY = frameY;
43548 Main.tile[x - 2, y + k].frameX = (short)(num - 36);
43549 Main.tile[x - 2, y + k].type = type;
43550 Main.tile[x - 1, y + k].active(active: true);
43551 Main.tile[x - 1, y + k].frameY = frameY;
43552 Main.tile[x - 1, y + k].frameX = (short)(num - 18);
43553 Main.tile[x - 1, y + k].type = type;
43554 Main.tile[x, y + k].active(active: true);
43555 Main.tile[x, y + k].frameY = frameY;
43556 Main.tile[x, y + k].frameX = (short)num;
43557 Main.tile[x, y + k].type = type;
43558 Main.tile[x + 1, y + k].active(active: true);
43559 Main.tile[x + 1, y + k].frameY = frameY;
43560 Main.tile[x + 1, y + k].frameX = (short)(num + 18);
43561 Main.tile[x + 1, y + k].type = type;
43562 Main.tile[x + 1, y + k].active(active: true);
43563 Main.tile[x + 1, y + k].frameY = frameY;
43564 Main.tile[x + 1, y + k].frameX = (short)(num + 36);
43565 Main.tile[x + 1, y + k].type = type;
43566 }
43567 }
43568 }
static bool SolidTile2(Tile testTile)

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