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

◆ CheckTileBreakability()

static int Terraria.WorldGen.CheckTileBreakability ( int x,
int y )
inlinestatic

Definition at line 56637 of file WorldGen.cs.

56638 {
56639 if (Main.tile[x, y] == null)
56640 {
56641 Main.tile[x, y] = default(Tile);
56642 }
56643 Tile tile = Main.tile[x, y];
56644 if (y >= 1 && y <= Main.maxTilesY - 1)
56645 {
56646 if (Main.tile[x, y - 1] == null)
56647 {
56648 Main.tile[x, y - 1] = default(Tile);
56649 }
56650 if (Main.tile[x, y + 1] == null)
56651 {
56652 Main.tile[x, y + 1] = default(Tile);
56653 }
56654 Tile tile2 = Main.tile[x, y - 1];
56655 Tile tile3 = Main.tile[x, y + 1];
56656 if (tile3 != null && tile3.active() && IsLockedDoor(x, y + 1))
56657 {
56658 return 2;
56659 }
56660 if (!Main.tileSolid[tile.type] && !Main.tileSolidTop[tile.type])
56661 {
56662 return 0;
56663 }
56664 if (tile2.active())
56665 {
56666 if ((TileID.Sets.PreventsTileRemovalIfOnTopOfIt[tile2.type] && tile.type != tile2.type) | IsLockedDoor(x, y - 1) | (tile2.type == 77 && tile.type != 77 && !Main.hardMode) | (IsAContainer(tile2) && !IsAContainer(tile)))
56667 {
56668 if (TileID.Sets.IsATreeTrunk[tile2.type])
56669 {
56670 if ((tile2.frameX == 66 && tile2.frameY >= 0 && tile2.frameY <= 44) || (tile2.frameX == 88 && tile2.frameY >= 66 && tile2.frameY <= 110) || tile2.frameY >= 198)
56671 {
56672 return 0;
56673 }
56674 return 2;
56675 }
56676 if (tile2.type == 323)
56677 {
56678 if (tile2.frameX == 66 || tile2.frameX == 220)
56679 {
56680 return 2;
56681 }
56682 return 0;
56683 }
56684 return 2;
56685 }
56686 if (tile2.type == 80 && tile2.type != tile.type)
56687 {
56688 int num = tile2.frameX / 18;
56689 if ((uint)num <= 1u || (uint)(num - 4) <= 1u)
56690 {
56691 return 2;
56692 }
56693 }
56694 if (tile.type == 10 && IsLockedDoor(tile))
56695 {
56696 return 1;
56697 }
56698 if (TileID.Sets.Boulders[tile.type])
56699 {
56700 if (CheckBoulderChest(x, y))
56701 {
56702 return 1;
56703 }
56704 return 0;
56705 }
56706 }
56707 if (tile.type == 235)
56708 {
56709 int frameX = tile.frameX;
56710 int num2 = x - frameX % 54 / 18;
56711 for (int i = 0; i < 3; i++)
56712 {
56713 if (Main.tile[num2 + i, y - 1].active() && IsAContainer(Main.tile[num2 + i, y - 1]))
56714 {
56715 return 2;
56716 }
56717 }
56718 }
56719 }
56720 return 0;
56721 }
static bool[] PreventsTileRemovalIfOnTopOfIt
Prevents a tile immediately below a tile of this type from being mineable. Use M:Terraria....
Definition TileID.cs:133
static bool[] Boulders
Definition TileID.cs:171
static bool[] IsATreeTrunk
If true for a given tile type (P:Terraria.Tile.TileType), then that tile is categorized as a tree tru...
Definition TileID.cs:114
static bool IsAContainer(Tile t)
static bool IsLockedDoor(int x, int y)
static bool CheckBoulderChest(int i, int j)

References Terraria.ID.TileID.Sets.Boulders, Terraria.Tile.frameX, Terraria.Main.hardMode, Terraria.ID.TileID.Sets.IsATreeTrunk, Terraria.Main.maxTilesY, Terraria.ID.TileID.Sets.PreventsTileRemovalIfOnTopOfIt, Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, and Terraria.Tile.type.

Referenced by Terraria.GameContent.MinecartDiggerHelper.CanGetPastTile().

+ Here is the caller graph for this function: