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

◆ Check3x6()

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

Definition at line 47546 of file WorldGen.cs.

47547 {
47548 if (destroyObject)
47549 {
47550 return;
47551 }
47552 bool flag = false;
47553 int num = i;
47554 int num2 = j;
47555 num = Main.tile[i, j].frameX / 18;
47556 int num3 = 0;
47557 while (num >= 3)
47558 {
47559 num3++;
47560 num -= 3;
47561 }
47562 int num4 = i - num;
47563 int num5 = 54 * num3;
47564 int num6 = Main.tile[i, j].frameY % 96 / 18;
47565 if (num >= 4)
47566 {
47567 num -= 3;
47568 }
47569 num = i - num;
47570 num2 -= num6;
47571 for (int k = num; k < num + 3; k++)
47572 {
47573 for (int l = num2; l < num2 + 6; l++)
47574 {
47575 if (Main.tile[k, l] == null)
47576 {
47577 Main.tile[k, l] = default(Tile);
47578 }
47579 if (!Main.tile[k, l].active() || Main.tile[k, l].type != type || Main.tile[k, l].frameX != (k - num4) * 18 + num5 || Main.tile[k, l].frameY != (l - num2) * 18)
47580 {
47581 flag = true;
47582 }
47583 }
47584 }
47585 for (int m = num; m < num + 3; m++)
47586 {
47587 if (Main.tile[m, num2 + 6] == null)
47588 {
47589 Main.tile[m, num2 + 6] = default(Tile);
47590 }
47591 if (!SolidTileAllowBottomSlope(m, num2 + 6))
47592 {
47593 flag = true;
47594 break;
47595 }
47596 }
47597 if (!flag)
47598 {
47599 return;
47600 }
47601 destroyObject = true;
47602 bool drop = TileLoader.Drop(i, j, type);
47603 for (int n = num; n < num + 3; n++)
47604 {
47605 for (int num7 = num2; num7 < num2 + 6; num7++)
47606 {
47607 if (Main.tile[n, num7].type == type && Main.tile[n, num7].active())
47608 {
47609 KillTile(n, num7);
47610 }
47611 }
47612 }
47613 using (new Item.DisableNewItemMethod(!drop))
47614 {
47615 if (type == 548)
47616 {
47617 if (num3 >= 7)
47618 {
47619 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4902 + num3 - 7);
47620 }
47621 else
47622 {
47623 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4435 + num3);
47624 }
47625 }
47626 if (type == 614)
47627 {
47628 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4906);
47629 }
47630 destroyObject = false;
47631 for (int num8 = num - 1; num8 < num + 4; num8++)
47632 {
47633 for (int num9 = num2 - 1; num9 < num2 + 7; num9++)
47634 {
47636 }
47637 }
47638 }
47639 }
static bool Drop(int i, int j, int type, bool includeLargeObjectDrops=true)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
static bool destroyObject
Definition WorldGen.cs:1258
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.ModLoader.TileLoader.Drop(), Terraria.Item.NewItem(), and Terraria.Main.tile.

+ Here is the call graph for this function: