Interface BarrelInventory

All Superinterfaces:
BlockInventory, Container

public interface BarrelInventory extends BlockInventory
The slots of a barrel, read from and written to its block entity as BlockInventory tells.

A barrel shows the rows the configuration of its world gives, from one to 6: its size is that of those rows. Its block entity holds up to 6 rows: when the configuration gives fewer rows than a barrel held, the items of the rows it no longer shows are either kept out of reach or cleared when a player opens it, as the configuration says. Breaking a barrel spills every item it holds, those of the rows it no longer shows included.

Choosing the rows of the barrels of a world is inspired by Purpur.

Since:
0.1.0
See Also:
  • Field Details

    • ROW_SIZE

      static final int ROW_SIZE
      The number of slots of one row.
      Since:
      0.1.0
      See Also:
    • MAX_ROWS

      static final int MAX_ROWS
      The most rows a barrel shows.
      Since:
      0.1.0
      See Also:
    • DEFAULT_ROWS

      static final int DEFAULT_ROWS
      The rows of a vanilla barrel.
      Since:
      0.1.0
      See Also:
  • Method Details

    • rows

      int rows()
      Returns the rows the barrel shows, from 1 to 6, as the configuration of its world gives them.
      Returns:
      the rows the barrel shows, from 1 to 6, as the configuration of its world gives them
      Since:
      0.1.0