====== cBlockEntityWithItems ======
This class is a common ancestor for all [[API:cBlockEntity|block entities]] that provide item storage. Internally, the object has a [[API:cItemGrid|cItemGrid]] object for storing the items; this ItemGrid is accessible through the API. The storage is a grid of items, items in it can be addressed either by a slot number, or by XY coords within the grid. If a UI window is opened for this block entity, the item storage is monitored for changes and the changes are immediately sent to clients of the UI window.

===== Ancestors =====
This class inherits from the [[API:cBlockEntity|cBlockEntity]] class.

===== Descendants =====
  * [[api:cChestEntity | cChestEntity]]
  * [[api:cDropSpenserEntity | cDropSpenserEntity]]
    * [[api:cDispenserEntity | cDispenserEntity]]
    * [[api:cDropperEntity | cDropperEntity]]
  * [[api:cFurnaceEntity | cFurnaceEntity]]
  * [[api:cHopperEntity | cHopperEntity]]

===== Functions =====
All the functions available in the parent, [[API:cBlockEntity|cBlockEntity]], are available for this class, too. Additionally, these specialized functions allow access to the internal item storage:
^ Function ^ Parameters ^ Return value ^ Notes ^
| GetContents | | [[API:cItemGrid|cItemGrid]] | Returns the cItemGrid object representing the items stored within this block entity |
| GetSlot | SlotNum | [[API:cItem|cItem]] | Returns the cItem for the specified slot number. Returns nil for invalid slot numbers |
| GetSlot | X, Y | [[API:cItem|cItem]] | Returns the cItem for the specified slot coords. Returns nil for invalid slot coords |
| SetSlot | SlotNum, [[API:cItem|cItem]] | | Sets the cItem for the specified slot number. Ignored if invalid slot number |
| SetSlot | X, Y, [[API:cItem|cItem]] | | Sets the cItem for the specified slot coords. Ignored if invalid slot coords |