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

◆ AdjTiles()

void Terraria.Player.AdjTiles ( )
inline

Definition at line 34464 of file Player.cs.

34465 {
34466 int num = 4;
34467 int num2 = 3;
34468 if (ateArtisanBread)
34469 {
34470 num += 4;
34471 num2 += 4;
34472 }
34473 for (int i = 0; i < adjTile.Length; i++)
34474 {
34475 oldAdjTile[i] = adjTile[i];
34476 adjTile[i] = false;
34477 }
34479 adjWater = false;
34481 adjHoney = false;
34483 adjLava = false;
34485 adjShimmer = false;
34486 alchemyTable = false;
34487 int num3 = (int)((position.X + (float)(width / 2)) / 16f);
34488 int num4 = (int)((position.Y + (float)height) / 16f);
34489 for (int j = num3 - num; j <= num3 + num; j++)
34490 {
34491 for (int k = num4 - num2; k < num4 + num2; k++)
34492 {
34493 if (Main.tile[j, k].active())
34494 {
34495 adjTile[Main.tile[j, k].type] = true;
34496 switch (Main.tile[j, k].type)
34497 {
34498 case 77:
34499 case 302:
34500 adjTile[17] = true;
34501 break;
34502 case 133:
34503 adjTile[17] = true;
34504 adjTile[77] = true;
34505 break;
34506 case 134:
34507 adjTile[16] = true;
34508 break;
34509 case 354:
34510 case 469:
34511 case 487:
34512 adjTile[14] = true;
34513 break;
34514 case 355:
34515 adjTile[13] = true;
34516 adjTile[14] = true;
34517 alchemyTable = true;
34518 break;
34519 }
34520 TileLoader.AdjTiles(this, Main.tile[j, k].type);
34521 }
34522 if ((Main.tile[j, k].liquid > 200 && Main.tile[j, k].liquidType() == 0) || TileID.Sets.CountsAsWaterSource[Main.tile[j, k].type])
34523 {
34524 adjWater = true;
34525 }
34526 if ((Main.tile[j, k].liquid > 200 && Main.tile[j, k].liquidType() == 2) || TileID.Sets.CountsAsHoneySource[Main.tile[j, k].type])
34527 {
34528 adjHoney = true;
34529 }
34530 if ((Main.tile[j, k].liquid > 200 && Main.tile[j, k].liquidType() == 1) || TileID.Sets.CountsAsLavaSource[Main.tile[j, k].type])
34531 {
34532 adjLava = true;
34533 }
34534 if ((Main.tile[j, k].liquid > 200 && Main.tile[j, k].liquidType() == 3) || TileID.Sets.CountsAsShimmerSource[Main.tile[j, k].type])
34535 {
34536 adjShimmer = true;
34537 }
34538 }
34539 }
34540 if (!Main.playerInventory)
34541 {
34542 return;
34543 }
34544 bool flag = false;
34545 for (int l = 0; l < adjTile.Length; l++)
34546 {
34547 if (oldAdjTile[l] != adjTile[l])
34548 {
34549 flag = true;
34550 break;
34551 }
34552 }
34553 if (adjWater != oldAdjWater)
34554 {
34555 flag = true;
34556 }
34557 if (adjHoney != oldAdjHoney)
34558 {
34559 flag = true;
34560 }
34561 if (adjLava != oldAdjLava)
34562 {
34563 flag = true;
34564 }
34566 {
34567 flag = true;
34568 }
34569 if (flag)
34570 {
34571 Recipe.FindRecipes();
34572 }
34573 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static bool[] CountsAsWaterSource
Whether or not this tile counts as a water source for crafting purposes.
Definition TileID.cs:441
static bool[] CountsAsHoneySource
Whether or not this tile counts as a honey source for crafting purposes.
Definition TileID.cs:444
static bool[] CountsAsLavaSource
Whether or not this tile counts as a lava source for crafting purposes.
Definition TileID.cs:447
static bool[] CountsAsShimmerSource
Whether or not this tile counts as a shimmer source for crafting purposes.
Definition TileID.cs:450
static void AdjTiles(Player player, int type)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
bool oldAdjShimmer
Definition Player.cs:2695
bool[] oldAdjTile
Definition Player.cs:3433
bool[] adjTile
Definition Player.cs:3417
bool alchemyTable
Definition Player.cs:997
bool ateArtisanBread
Definition Player.cs:2243

References Terraria.Player.adjHoney, Terraria.Player.adjLava, Terraria.Player.adjShimmer, Terraria.Player.adjTile, Terraria.ModLoader.TileLoader.AdjTiles(), Terraria.Player.adjWater, Terraria.Player.alchemyTable, Terraria.Player.ateArtisanBread, Terraria.ID.TileID.Sets.CountsAsHoneySource, Terraria.ID.TileID.Sets.CountsAsLavaSource, Terraria.ID.TileID.Sets.CountsAsShimmerSource, Terraria.ID.TileID.Sets.CountsAsWaterSource, Terraria.Recipe.FindRecipes(), Terraria.Entity.height, Terraria.Player.oldAdjHoney, Terraria.Player.oldAdjLava, Terraria.Player.oldAdjShimmer, Terraria.Player.oldAdjTile, Terraria.Player.oldAdjWater, Terraria.Main.playerInventory, Terraria.Entity.position, Terraria.Main.tile, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: