public override void WalkInventory(OnInventorySlot handler) { IPlayer player = World.PlayerByUid(PlayerUID); foreach (InventoryBase inv in player.InventoryManager.Inventories.Values) { if (inv.ClassName == "creative") { continue; } if (!inv.HasOpened(player)) { continue; } int q = inv.Count; for (int i = 0; i < q; i++) { if (!handler(inv[i])) { return; } } } }
/// <summary> /// This walks the inventory for the entity agent. /// </summary> /// <param name="handler">the event to fire while walking the inventory.</param> public virtual void WalkInventory(OnInventorySlot handler) { }