Package org.bukkit.block
Interface EntityBlockStorage<T extends Entity>
- Type Parameters:
T
- Entity this block can store
- All Superinterfaces:
BlockState
,Metadatable
,PersistentDataHolder
,TileState
- All Known Subinterfaces:
Beehive
Represents a captured state of a block which stores entities.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an entity to the block.void
Clear all currently stored entities in the block.Gets all the entities currently stored in the block.int
Get the amount of entities currently in this block.int
Get the maximum amount of entities this block can hold.boolean
isFull()
Check if the block is completely full of entities.Release all the entities currently stored in the block.releaseEntity
(StoredEntity<T> entity) Releases a stored entity, and returns the entity in the world.void
setMaxEntities
(int max) Set the maximum amount of entities this block can hold.Methods inherited from interface org.bukkit.block.BlockState
copy, getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.block.TileState
getPersistentDataContainer, isSnapshot
-
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
Release all the entities currently stored in the block.- Returns:
- List of all entities which were released
-
releaseEntity
Releases a stored entity, and returns the entity in the world.- Parameters:
entity
- Entity to release- Returns:
- The entity which was released, or null if the stored entity is not in the hive
-
getEntities
Gets all the entities currently stored in the block.- Returns:
- List of all entities which are stored in the block
-
addEntity
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.
-