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

◆ ClearAllDD2EnergyCrystalsInChests()

static void Terraria.GameContent.Events.DD2Event.ClearAllDD2EnergyCrystalsInChests ( )
inlinestatic

Definition at line 665 of file DD2Event.cs.

666 {
667 if (Main.netMode == 1)
668 {
669 return;
670 }
671 List<int> currentlyOpenChests = Chest.GetCurrentlyOpenChests();
672 for (int i = 0; i < 8000; i++)
673 {
674 Chest chest = Main.chest[i];
675 if (chest == null || !currentlyOpenChests.Contains(i))
676 {
677 continue;
678 }
679 for (int j = 0; j < 40; j++)
680 {
681 if (chest.item[j].type == 3822 && chest.item[j].stack > 0)
682 {
683 chest.item[j].TurnToAir();
684 if (Main.netMode != 0)
685 {
686 NetMessage.SendData(32, -1, -1, null, i, j);
687 }
688 }
689 }
690 }
691 }

References Terraria.Main.chest, Terraria.Chest.GetCurrentlyOpenChests(), Terraria.Chest.item, Terraria.Main.netMode, Terraria.NetMessage.SendData(), Terraria.Item.stack, Terraria.Item.TurnToAir(), and Terraria.Item.type.

Referenced by Terraria.GameContent.Events.DD2Event.WipeEntities().

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