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

◆ GetGemTreeFoliageData()

static bool Terraria.WorldGen.GetGemTreeFoliageData ( int i,
int j,
int xoffset,
ref int treeFrame,
ref int treeStyle,
out int floorY,
out int topTextureFrameWidth,
out int topTextureFrameHeight )
inlinestatic

Definition at line 53502 of file WorldGen.cs.

53503 {
53504 Tile tile = Main.tile[i, j];
53505 int num = i + xoffset;
53508 floorY = j;
53509 if (!GrowTreeSettings.Profiles.TryGetFromTreeId(tile.type, out var profile))
53510 {
53511 return false;
53512 }
53513 for (int k = 0; k < 100; k++)
53514 {
53515 floorY = j + k;
53516 Tile tile2 = Main.tile[num, floorY];
53517 if (tile2 == null)
53518 {
53519 return false;
53520 }
53521 if (profile.GroundTest(tile2.type))
53522 {
53523 switch (tile.type)
53524 {
53525 case 583:
53526 treeStyle = 22;
53527 return true;
53528 case 584:
53529 treeStyle = 23;
53530 return true;
53531 case 585:
53532 treeStyle = 24;
53533 return true;
53534 case 586:
53535 treeStyle = 25;
53536 return true;
53537 case 587:
53538 treeStyle = 26;
53539 return true;
53540 case 588:
53541 treeStyle = 27;
53542 return true;
53543 case 589:
53544 treeStyle = 28;
53545 return true;
53546 }
53547 }
53548 }
53549 return false;
53550 }

References Terraria.Main.tile, Terraria.WorldGen.GrowTreeSettings.Profiles.TryGetFromTreeId(), and Terraria.Tile.type.

Referenced by Terraria.GameContent.Drawing.TileDrawing.DrawTrees(), and Terraria.GameContent.Drawing.TileDrawing.MakeExtraPreparations().