Getting contents of an ItemContainer by UID?

Hi.

I cant seem to figure it out.

I have a known UID for an ItemContainer but I cant seem to access the contents of the ItemContainer. Is it even possible?

(This is code only to test it out)

private void RetrieveItems(BasePlayer player, uint UID)
{
    ItemContainer TempInv = new ItemContainer();
    TempInv.FindContainer(UID);

    foreach (Item k in TempInv.itemList.ToArray())
    {
        k.MoveToContainer(player.inventory.containerBelt);
    }
}

private void StoreItems(BasePlayer player)
{
    ItemContainer TempInv = new ItemContainer();
    TempInv.entityOwner = player;
    TempInv.capacity = 100;
    TempInv.isServer = true;
    TempInv.allowedContents = ItemContainer.ContentsType.Generic;
    TempInv.GiveUID();

    foreach (Item k in player.inventory.containerBelt.itemList.ToArray()) {
        k.MoveToContainer(TempInv);
    }

    Puts($"{TempInv.uid}");
    RetrieveItems(player, TempInv.uid);
}
IIRC you cannot find item containers like that, it just will not work this way. You cannot just make a new container and run FindContainer.

Merged post

The only thing you can do is save it's parent uid and then find it's parent entity and then get its container. Because FindContainer only checks items inside the current container