T
- Tile entity type, the specified TE must be a Carrier
public interface TileEntityInventory<T extends TileEntity & Carrier> extends PersistentInventory, Interactable, CarriedInventory<T>
Inventory
which is owned by a
TileEntity
. In Sponge, a TE is never seen as an Inventory itself and
Tile Entities are instead considered to "own" their own Inventory (much like
equipable entities do). Underlying implementations are of course completely
at liberty to return the TE object directly but as far as consumers are
concerned the TE instance and the inventory are separate things.
This is intended to provide a consistent way of dealing with inventories
regardless of the "owner" of the inventory. Thus, any code capable of dealing
with a Carrier
is intrinsically able to deal with a TE inventory just
as they would with any Entity inventory or any other type of Carrier for that
matter.
This separation of inventory logic from the TE itself also serves to provide some flexibility for implementors, since it is possible that not all implementations may take the view that a TE embodies its own inventory.
Inventory.Builder
Modifier and Type | Method and Description |
---|---|
Optional<T> |
getTileEntity()
Returns the owner of this Inventory.
|
markDirty
canInteractWith
getCarrier
builder, canFit, capacity, clear, contains, contains, containsAny, containsInventory, first, getArchetype, getInventoryProperty, getInventoryProperty, getMaxStackSize, getPlugin, getProperties, getProperties, getProperty, getProperty, hasChildren, intersect, next, offer, parent, peek, peek, poll, poll, query, query, query, query, query, query, query, queryAny, root, set, setMaxStackSize, size, slots, totalItems, transform, union
forEach, iterator, spliterator