Inventory
abstract class Inventory( inventoryId: Int, raw: ItemContainer?, stack: ItemContainerStackBehaviour? = null) : Component(), Syncablefun pickUp(player: Actor, item: WorldItem, bag: InventoryDefinition) { val inventory = player.allComponents().filterIsInstance<Inventory>().firstOrNull { it.inventoryId == bag.id } if (inventory == null || inventory.isFull) return player.message("You have no room.") inventory.add(Item(item.stack.id, item.quantity)) item.remove()}inventoryId
Section titled “inventoryId”open val inventoryId: Intval raw: ItemContainerrefusalToJoin
Section titled “refusalToJoin”override fun refusalToJoin(entity: rift.entities.Entity): String?capacity
Section titled “capacity”val capacity: Intfun fill(vararg items: Item)fun add( item: Item, assureFullInsertion: Boolean = true, beginSlot: Int = -1): ItemTransactionremove
Section titled “remove”fun remove( item: Item, assureFullRemoval: Boolean = false, beginSlot: Int = -1): ItemTransactionfun count(item: Int): IntfreeSlotCount
Section titled “freeSlotCount”val freeSlotCount: IntisFull
Section titled “isFull”val isFull: BooleanremoveAll
Section titled “removeAll”fun removeAll(): Unitfun move( from: Int, to: Int): Unitcontents
Section titled “contents”val contents: Array<Item?>syncTo
Section titled “syncTo”override fun syncTo(client: Actor)markDirty
Section titled “markDirty”override fun markDirty()var dirty: Boolean