public ItemPickupEvent(CollectibleEntity collectibleEntity, BaseEntity.RPCMessage msg, Item item) { Entity = collectibleEntity; RPCMessage = msg; Player = Server.GetPlayer(msg.player); Item = new InvItem(item); }
public ItemConditionEvent(Item item, float amount) { Item = new InvItem(item); Amount = amount; BasePlayer ownerPlayer = item.GetOwnerPlayer(); if (ownerPlayer != null) { Player = Server.GetPlayer(ownerPlayer); } }
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); }
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); } }
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); } }
public PlayerClothingEvent(PlayerInventory playerInventory, Item item) { Player = Server.GetPlayer(playerInventory.containerMain.playerOwner); Item = new InvItem(item); }
public ItemUsedEvent(Item item, int amount) { Item = new InvItem(item); Amount = amount; }
public InvItem(Item item) { _item = item; containerPref = GetContainerPreference(Category); }
public ConsumeFuelEvent(BaseOven baseOven, Item fuel, ItemModBurnable burnable) { BaseOven = baseOven; Item = new InvItem(fuel); Burnable = burnable; }