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

◆ Check3x5()

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

Definition at line 47462 of file WorldGen.cs.

47463 {
47464 if (destroyObject)
47465 {
47466 return;
47467 }
47468 bool flag = false;
47469 int num = i;
47470 int num2 = j;
47471 num = Main.tile[i, j].frameX / 18;
47472 int num3 = 0;
47473 while (num >= 3)
47474 {
47475 num3++;
47476 num -= 3;
47477 }
47478 int num4 = i - num;
47479 int num5 = 54 * num3;
47480 int num6 = Main.tile[i, j].frameY % 90 / 18;
47481 if (num >= 4)
47482 {
47483 num -= 3;
47484 }
47485 num = i - num;
47486 num2 -= num6;
47487 for (int k = num; k < num + 3; k++)
47488 {
47489 for (int l = num2; l < num2 + 5; l++)
47490 {
47491 if (Main.tile[k, l] == null)
47492 {
47493 Main.tile[k, l] = default(Tile);
47494 }
47495 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)
47496 {
47497 flag = true;
47498 }
47499 }
47500 }
47501 for (int m = num; m < num + 3; m++)
47502 {
47503 if (Main.tile[m, num2 + 5] == null)
47504 {
47505 Main.tile[m, num2 + 5] = default(Tile);
47506 }
47507 if (!SolidTileAllowBottomSlope(m, num2 + 5))
47508 {
47509 flag = true;
47510 break;
47511 }
47512 }
47513 if (!flag)
47514 {
47515 return;
47516 }
47517 destroyObject = true;
47518 bool drop = TileLoader.Drop(i, j, type);
47519 for (int n = num; n < num + 3; n++)
47520 {
47521 for (int num7 = num2; num7 < num2 + 5; num7++)
47522 {
47523 if (Main.tile[n, num7].type == type && Main.tile[n, num7].active())
47524 {
47525 KillTile(n, num7);
47526 }
47527 }
47528 }
47529 using (new Item.DisableNewItemMethod(!drop))
47530 {
47531 if (type == 613)
47532 {
47533 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4904 + num3);
47534 }
47535 destroyObject = false;
47536 for (int num8 = num - 1; num8 < num + 4; num8++)
47537 {
47538 for (int num9 = num2 - 1; num9 < num2 + 6; num9++)
47539 {
47541 }
47542 }
47543 }
47544 }
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: