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

◆ Check3x1()

static void Terraria.WorldGen.Check3x1 ( int i,
int j,
int type )
inlinestatic

Definition at line 40463 of file WorldGen.cs.

40464 {
40465 if (destroyObject)
40466 {
40467 return;
40468 }
40469 bool flag = false;
40470 if (Main.tile[i, j] == null)
40471 {
40472 Main.tile[i, j] = new Tile();
40473 }
40474 int num = Main.tile[i, j].frameX / 18;
40475 int num2 = 0;
40476 while (num > 2)
40477 {
40478 num -= 3;
40479 num2++;
40480 }
40481 num = i - num;
40482 int num3 = num2 * 54;
40483 for (int k = num; k < num + 3; k++)
40484 {
40485 if (Main.tile[k, j] == null)
40486 {
40487 Main.tile[k, j] = new Tile();
40488 }
40489 if (!Main.tile[k, j].active() || Main.tile[k, j].type != type || Main.tile[k, j].frameX != (k - num) * 18 + num3 || Main.tile[k, j].frameY != 0)
40490 {
40491 flag = true;
40492 }
40493 if (Main.tile[k, j - 1] == null)
40494 {
40495 Main.tile[k, j - 1] = new Tile();
40496 }
40497 if (Main.tile[k, j - 1].active() && (TileID.Sets.BasicChest[Main.tile[k, j - 1].type] || TileID.Sets.BasicChestFake[Main.tile[k, j - 1].type] || Main.tile[k, j - 1].type == 88 || Main.tile[k, j - 1].type == 470 || Main.tile[k, j - 1].type == 475 || Main.tile[k, j - 1].type == 597))
40498 {
40499 return;
40500 }
40501 if (!SolidTileAllowBottomSlope(k, j + 1))
40502 {
40503 flag = true;
40504 }
40505 }
40506 if (!flag)
40507 {
40508 return;
40509 }
40510 _ = Main.tile[i, j].frameX;
40511 destroyObject = true;
40512 if (type == 235)
40513 {
40514 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 1263);
40515 }
40516 for (int l = num; l < num + 3; l++)
40517 {
40518 if (Main.tile[l, j] == null)
40519 {
40520 Main.tile[l, j] = new Tile();
40521 }
40522 if (Main.tile[l, j].type == type && Main.tile[l, j].active())
40523 {
40524 KillTile(l, j);
40525 }
40526 }
40527 destroyObject = false;
40528 for (int m = num - 1; m < num + 4; m++)
40529 {
40530 TileFrame(m, j);
40531 }
40532 }
static bool[] BasicChest
Definition TileID.cs:223
static bool[] BasicChestFake
Definition TileID.cs:225
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool SolidTileAllowBottomSlope(int i, int j)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.ID.TileID.Sets.BasicChest, Terraria.ID.TileID.Sets.BasicChestFake, Terraria.Item.NewItem(), Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.