public void AddItem(Gatherable item) { if (!Items?.SetFirstNullItem(this, item) ?? true) { PluginLog.Error($"Could not add additional item {item} to node {Meta?.PointBaseId}, all 9 slots are used."); } }
// Set the first item that is currently null. Returns false if all items were null. public bool SetFirstNullItem(Node node, Gatherable item) { for (var i = 0; i < Items.Length; ++i) { if (Items[i] == null) { Items[i] = item; item.NodeList.Add(node); return(true); } } return(false); }