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

◆ ClearAllDD2EnergyCrystalsInChests()

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

Definition at line 650 of file DD2Event.cs.

651 {
652 if (Main.netMode == 1)
653 {
654 return;
655 }
656 List<int> currentlyOpenChests = Chest.GetCurrentlyOpenChests();
657 for (int i = 0; i < 8000; i++)
658 {
659 Chest chest = Main.chest[i];
660 if (chest == null || !currentlyOpenChests.Contains(i))
661 {
662 continue;
663 }
664 for (int j = 0; j < 40; j++)
665 {
666 if (chest.item[j].type == 3822 && chest.item[j].stack > 0)
667 {
668 chest.item[j].TurnToAir();
669 if (Main.netMode != 0)
670 {
671 NetMessage.SendData(32, -1, -1, null, i, j);
672 }
673 }
674 }
675 }
676 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)

References Terraria.Main.chest, System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), 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().