Interface EntityBlockStorage<T extends Entity>

Type Parameters:
T - Entity this block can store
All Superinterfaces:
BlockState, Metadatable, PersistentDataHolder, PersistentDataViewHolder, TileState
All Known Subinterfaces:
Beehive

public interface EntityBlockStorage<T extends Entity> extends TileState
Represents a captured state of a block which stores entities.
  • Method Details

    • isFull

      boolean isFull()
      Check if the block is completely full of entities.
      Returns:
      True if block is full
    • getEntityCount

      int getEntityCount()
      Get the amount of entities currently in this block.
      Returns:
      Amount of entities currently in this block
    • getMaxEntities

      int getMaxEntities()
      Get the maximum amount of entities this block can hold.
      Returns:
      Maximum amount of entities this block can hold
    • setMaxEntities

      void setMaxEntities(int max)
      Set the maximum amount of entities this block can hold.
      Parameters:
      max - Maximum amount of entities this block can hold
    • releaseEntities

      @NotNull @NotNull List<T> releaseEntities()
      Release all the entities currently stored in the block.
      Returns:
      List of all entities which were released
    • addEntity

      void addEntity(@NotNull T entity)
      Add an entity to the block.
      Parameters:
      entity - Entity to add to the block
    • clearEntities

      void clearEntities()
      Clear all currently stored entities in the block.