Container playerInventory = player.GetContainerOfType(CollectionTypes.Inventory); var fullInventory = playerInventory.Contents.GetItems();
Container playerInventory = player.GetContainerOfType(CollectionTypes.Inventory); var fullInventory = playerInventory.Contents.ToList();
private static void fillInvList()
{
if (SelectedEntity == null || SelectedEntity.Controller.Id == ServerID)
return;
Entity player = SelectedEntity;
Container playerInv = player.GetContainerOfType(CollectionTypes.Inventory);
playerInventory = playerInv.Contents.ToList();
int count = 0;
foreach (var item in playerInventory)
{
if (item != null && item.Name != null)
{
GUI.Label(new Rect(0, (20 * count), 195, 20), string.Format("{0} : {1}", item.Name, item.StackAmount), PlayerListBtnStyle);
count++;
}
}
}
. Core.Cache.ContainerEntity instead of the usual .Entity for players