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

◆ LoadContainers()

static void Terraria.ModLoader.IO.TileIO.LoadContainers ( TagCompound tag)
inlinestaticpackage

Definition at line 417 of file TileIO.cs.

418 {
419 if (tag.ContainsKey("data"))
420 {
421 ReadContainers(new BinaryReader(tag.GetByteArray("data").ToMemoryStream()));
422 }
423 foreach (TagCompound frameTag in tag.GetList<TagCompound>("itemFrames"))
424 {
425 if (TileEntity.ByID.TryGetValue(frameTag.GetInt("id"), out var tileEntity) && tileEntity is TEItemFrame itemFrame)
426 {
427 ItemIO.Load(itemFrame.item, frameTag.GetCompound("item"));
428 }
429 else
430 {
431 Logging.tML.Warn((object)("Due to a bug in previous versions of tModLoader, the following ItemFrame data has been lost: " + frameTag.ToString()));
432 }
433 }
434 }
static Dictionary< int, TileEntity > ByID
Definition TileEntity.cs:20
static void ReadContainers(BinaryReader reader)
Definition TileIO.cs:436

References Terraria.DataStructures.TileEntity.ByID, Terraria.ModLoader.IO.ItemIO.Load(), Terraria.ModLoader.IO.TileIO.ReadContainers(), and Terraria.ModLoader.Logging.tML.

Referenced by Terraria.ModLoader.IO.WorldIO.Load().

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