private void DoSetupFilter(MyConveyorSorterMode mode, List <MyInventoryItemFilter> items) { this.IsWhitelist = mode == MyConveyorSorterMode.Whitelist; this.m_inventoryConstraint.Clear(); if (items != null) { this.m_allowCurrentListUpdate = false; try { foreach (MyInventoryItemFilter filter in items) { if (filter.AllSubTypes) { this.m_inventoryConstraint.AddObjectBuilderType(filter.ItemId.TypeId); continue; } this.m_inventoryConstraint.Add(filter.ItemId); } } finally { this.m_allowCurrentListUpdate = true; } } base.CubeGrid.GridSystems.ConveyorSystem.FlagForRecomputation(); currentList.UpdateVisual(); }
void Sandbox.ModAPI.Ingame.IMyConveyorSorter.SetFilter(MyConveyorSorterMode mode, List <MyInventoryItemFilter> items) { EndpointId targetEndpoint = new EndpointId(); Sandbox.Engine.Multiplayer.MyMultiplayer.RaiseEvent <MyConveyorSorter, MyConveyorSorterMode, List <MyInventoryItemFilter> >(this, x => new Action <MyConveyorSorterMode, List <MyInventoryItemFilter> >(x.DoSetupFilter), mode, items, targetEndpoint); }