public override void ServerInit() { if (this.inventory == null) { this.CreateInventory(true); this.OnInventoryFirstCreated(this.inventory); } ItemBasedFlowRestrictor itemBasedFlowRestrictor = this; base.InvokeRandomized(new Action(itemBasedFlowRestrictor.TickPassthroughItem), 1f, 1f, 0.015f); base.ServerInit(); }
public void CreateInventory(bool giveUID) { this.inventory = new ItemContainer() { entityOwner = this, allowedContents = ((int)this.allowedContents == 0 ? ItemContainer.ContentsType.Generic : this.allowedContents), onlyAllowedItem = this.passthroughItem, maxStackSize = this.maxStackSize }; this.inventory.ServerInitialize(null, this.numSlots); if (giveUID) { this.inventory.GiveUID(); } ItemBasedFlowRestrictor itemBasedFlowRestrictor = this; this.inventory.onItemAddedRemoved = new Action <Item, bool>(itemBasedFlowRestrictor.OnItemAddedOrRemoved); }