void DoSetupFilter(ModAPI.Ingame.MyConveyorSorterMode mode, List <ModAPI.Ingame.MyInventoryItemFilter> items) { IsWhitelist = mode == ModAPI.Ingame.MyConveyorSorterMode.Whitelist; m_inventoryConstraint.Clear(); if (items != null) { m_allowCurrentListUpdate = false; try { foreach (var item in items) { if (item.AllSubTypes) { m_inventoryConstraint.AddObjectBuilderType(item.ItemId.TypeId); } else { m_inventoryConstraint.Add(item.ItemId); } } } finally { m_allowCurrentListUpdate = true; } } // Recompute because of new sorter settings CubeGrid.GridSystems.ConveyorSystem.FlagForRecomputation(); currentList.UpdateVisual(); }
void ModAPI.Ingame.IMyConveyorSorter.SetFilter(ModAPI.Ingame.MyConveyorSorterMode mode, List <ModAPI.Ingame.MyInventoryItemFilter> items) { // Update everyone else - except self MyMultiplayer.RaiseEvent(this, x => x.DoSetupFilter, mode, items); }