Пример #1
0
 public ItemPickupEvent(CollectibleEntity collectibleEntity, BaseEntity.RPCMessage msg, Item item)
 {
     Entity = collectibleEntity;
     RPCMessage = msg;
     Player = Server.GetPlayer(msg.player);
     Item = new InvItem(item);
 }
Пример #2
0
        public ItemConditionEvent(Item item, float amount)
        {
            Item = new InvItem(item);
            Amount = amount;

            BasePlayer ownerPlayer = item.GetOwnerPlayer();

            if (ownerPlayer != null) {
                Player = Server.GetPlayer(ownerPlayer);
            }
        }
Пример #3
0
        public InventoryModEvent(ItemContainer itemContainer, Item item)
        {
            ItemContainer = itemContainer;
            Item = new InvItem(item);

            if (itemContainer.playerOwner != null)
                Player = Server.GetPlayer(itemContainer.playerOwner);

            if (itemContainer.entityOwner != null)
                Entity = new Entity(itemContainer.entityOwner);
        }
Пример #4
0
        public InvItem(string name)
        {
            Item item = ItemManager.CreateByItemID(GetItemID(name), 1);

            if (item == null) {
                Logger.LogDebug($"[InvItem] Couldn't create item: 1x{name}");
                _item = null;
            } else {
                _item = item;
                containerPref = GetContainerPreference(Category);
            }
        }
Пример #5
0
        public InvItem(int itemid, int amount = 1)
        {
            Item item = ItemManager.CreateByItemID(itemid, amount);

            if (item == null) {
                Logger.LogDebug($"[InvItem] Couldn't create item: {amount}x{itemid}");
                _item = null;
            } else {
                _item = item;
                containerPref = GetContainerPreference(Category);
            }
        }
Пример #6
0
 public PlayerClothingEvent(PlayerInventory playerInventory, Item item)
 {
     Player = Server.GetPlayer(playerInventory.containerMain.playerOwner);
     Item = new InvItem(item);
 }
Пример #7
0
 public ItemUsedEvent(Item item, int amount)
 {
     Item = new InvItem(item);
     Amount = amount;
 }
Пример #8
0
 public InvItem(Item item)
 {
     _item = item;
     containerPref = GetContainerPreference(Category);
 }
Пример #9
0
 public ConsumeFuelEvent(BaseOven baseOven, Item fuel, ItemModBurnable burnable)
 {
     BaseOven = baseOven;
     Item = new InvItem(fuel);
     Burnable = burnable;
 }