Interface BlockEntityVolume
-
- All Superinterfaces:
BlockVolume
,Volume
- All Known Subinterfaces:
BlockEntityVolume.Modifiable<M>
,BlockEntityVolume.Mutable
,BlockEntityVolume.Streamable<T>
,BlockEntityVolume.Unmodifiable<U>
,Chunk<P>
,ClientWorld
,EnvironmentalVolume
,GenerationChunk
,GenerationRegion
,PrimitiveGameVolume
,Region<R>
,ServerWorld
,World<W,L>
,WorldChunk
,WorldLike<P>
public interface BlockEntityVolume extends BlockVolume, Volume
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
BlockEntityVolume.Modifiable<M extends BlockEntityVolume.Modifiable<M>>
static interface
BlockEntityVolume.Mutable
static interface
BlockEntityVolume.Streamable<T extends BlockEntityVolume.Streamable<T>>
static interface
BlockEntityVolume.Unmodifiable<U extends BlockEntityVolume.Unmodifiable<U>>
-
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.block.BlockVolume
BlockVolume.Immutable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Collection<? extends BlockEntity>
blockEntities()
Return a collection of block entities contained within this volume, possibly only returning block entities only in loaded areas.default Collection<? extends BlockEntity>
blockEntities(Predicate<? super BlockEntity> filter)
Return a collection of block entities contained within this volume, possibly only returning block entities only in loaded areas.Optional<? extends BlockEntity>
blockEntity(int x, int y, int z)
Gets the block entity at the given position, if it exists.default Optional<? extends BlockEntity>
blockEntity(Vector3i position)
Gets the block entity at the given position, if it exists.-
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume
block, block, fluid, fluid, highestPositionAt, highestYAt, highestYAt
-
-
-
-
Method Detail
-
blockEntities
Collection<? extends BlockEntity> blockEntities()
Return a collection of block entities contained within this volume, possibly only returning block entities only in loaded areas.For world implementations, only some parts of the world is usually loaded, so this method will only return block entities within those loaded parts.
- Returns:
- A collection of entities
-
blockEntities
default Collection<? extends BlockEntity> blockEntities(Predicate<? super BlockEntity> filter)
Return a collection of block entities contained within this volume, possibly only returning block entities only in loaded areas. The returned block entities are filtered by the givenPredicate
before being returned.For world implementations, only some parts of the world is usually loaded, so this method will only return block entities within those loaded parts.
- Parameters:
filter
- The filter to apply to the returned entities- Returns:
- A collection of filtered entities
-
blockEntity
default Optional<? extends BlockEntity> blockEntity(Vector3i position)
Gets the block entity at the given position, if it exists.- Parameters:
position
- The position- Returns:
- The block entity, or
Optional.empty()
-
blockEntity
Optional<? extends BlockEntity> blockEntity(int x, int y, int z)
Gets the block entity at the given position, if it exists.- Parameters:
x
- The X positiony
- The Y positionz
- The Z position- Returns:
- The block entity, or
Optional.empty()
-
-