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

◆ CheckPalmTree()

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

Definition at line 48414 of file WorldGen.cs.

48415 {
48416 int num = -1;
48417 int num2 = -1;
48418 int type = Main.tile[i, j].type;
48419 int frameX = Main.tile[i, j].frameX;
48420 int frameY = Main.tile[i, j].frameY;
48421 if (Main.tile[i, j - 1] != null && Main.tile[i, j - 1].active())
48422 {
48423 num = Main.tile[i, j - 1].type;
48424 }
48425 if (Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active())
48426 {
48427 num2 = Main.tile[i, j + 1].type;
48428 }
48429 if (num2 == 53)
48430 {
48431 num2 = 53;
48432 }
48433 if (num2 == 234)
48434 {
48435 num2 = 53;
48436 }
48437 if (num2 == 116)
48438 {
48439 num2 = 53;
48440 }
48441 if (num2 == 112)
48442 {
48443 num2 = 53;
48444 }
48446 {
48447 num2 = 53;
48448 }
48449 if (num2 != 53 && num2 != type)
48450 {
48451 KillTile(i, j);
48452 }
48453 if ((Main.tile[i, j].frameX == 66 || Main.tile[i, j].frameX == 220) && num2 != 53)
48454 {
48455 KillTile(i, j);
48456 }
48457 if (num != type && Main.tile[i, j].frameX <= 44)
48458 {
48459 Main.tile[i, j].frameX = (short)(genRand.Next(7, 10) * 22);
48460 }
48461 else if (num != type && Main.tile[i, j].frameX == 66)
48462 {
48463 Main.tile[i, j].frameX = 220;
48464 }
48465 if (Main.tile[i, j].frameX != frameX && Main.tile[i, j].frameY != frameY && frameX >= 0 && frameY >= 0)
48466 {
48467 TileFrame(i - 1, j);
48468 TileFrame(i + 1, j);
48469 TileFrame(i, j - 1);
48470 TileFrame(i, j + 1);
48471 }
48472 }
static bool CanGrowModPalmTree(int type)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static UnifiedRandom genRand
Definition WorldGen.cs:1455
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)

References Terraria.ModLoader.TileLoader.CanGrowModPalmTree(), and Terraria.Main.tile.

+ Here is the call graph for this function: