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

◆ CheckGnome()

static void Terraria.WorldGen.CheckGnome ( int x,
int j )
inlinestatic

Definition at line 47983 of file WorldGen.cs.

47984 {
47985 if (destroyObject)
47986 {
47987 return;
47988 }
47989 int num = 567;
47990 int num2 = j;
47991 bool flag = true;
47992 Tile tileSafely = Framing.GetTileSafely(x, num2);
47993 Tile tileSafely2 = Framing.GetTileSafely(x, num2 + 1);
47994 if (tileSafely.frameY > 0)
47995 {
47996 num2--;
47997 tileSafely = Framing.GetTileSafely(x, num2);
47998 tileSafely2 = Framing.GetTileSafely(x, num2 + 1);
47999 }
48000 _ = tileSafely.frameX / 28;
48001 if (tileSafely.frameY == 0 && tileSafely2.frameY == 20 && tileSafely.type == num && tileSafely2.type == num)
48002 {
48003 flag = false;
48004 }
48005 if (Main.tile[x, num2 + 2] == null)
48006 {
48007 Main.tile[x, num2 + 2] = default(Tile);
48008 }
48009 if (!SolidTileAllowBottomSlope(x, num2 + 2) && !TileID.Sets.Platforms[Main.tile[x, num2 + 2].type])
48010 {
48011 flag = true;
48012 }
48013 if (!flag)
48014 {
48015 return;
48016 }
48017 destroyObject = true;
48018 bool drop = TileLoader.Drop(x, j, num);
48019 if (tileSafely.type == num)
48020 {
48021 KillTile(x, num2);
48022 }
48023 if (tileSafely2.type == num)
48024 {
48025 KillTile(x, num2 + 1);
48026 }
48027 using (new Item.DisableNewItemMethod(!drop))
48028 {
48029 Item.NewItem(GetItemSource_FromTileBreak(x, num2), x * 16, num2 * 16, 16, 32, 4609);
48030 destroyObject = false;
48031 }
48032 }
static bool[] Platforms
Definition TileID.cs:219
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 bool SolidTileAllowBottomSlope(int i, int j)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.ModLoader.TileLoader.Drop(), Terraria.Framing.GetTileSafely(), Terraria.Item.NewItem(), Terraria.ID.TileID.Sets.Platforms, and Terraria.Main.tile.

+ Here is the call graph for this function: