Class VolumeApplicators
java.lang.Object
org.spongepowered.api.world.volume.stream.VolumeApplicators
A collection of default implemented
VolumeApplicators for various
"traditional" use cases.-
Method Summary
Modifier and TypeMethodDescriptionstatic <M extends BiomeVolume.Modifiable<M>>
VolumeApplicator<M, Biome, Boolean> A potentially usefulVolumeApplicatorthat attempts to apply aBiomeonto a targetBiomeVolume, returningbooleanwhether the biome was successfully set.static <M extends BlockEntityVolume.Modifiable<M>>
VolumeApplicator<M, BlockEntity, Boolean> A generic applicator to add aBlockEntityto a targetvolume.static <M extends BlockEntityVolume.Modifiable<M> & LocationCreator<? extends @NonNull Object,? extends ServerLocation>>
VolumeApplicator<M, BlockEntityArchetype, Optional<? extends BlockEntity>> A potentially usefulVolumeApplicatorthat attempts to apply aBlockEntityArchetypeonto a targetBlockEntityVolume, optionally returning a newly placedBlockEntity.static <M extends BlockEntityArchetypeVolume.Modifiable<M>>
VolumeApplicator<M, BlockEntityArchetype, Boolean> A potentially usefulVolumeApplicatorthat attempts to apply aBlockEntityArchetypeonto a targetBlockEntityVolume, optionally returning a newly placedBlockEntity.static <M extends BlockVolume.Modifiable<M>>
VolumeApplicator<M, BlockState, Boolean> static <M extends PhysicsAwareMutableBlockVolume<M>>
VolumeApplicator<M, BlockState, Boolean> applyBlocks(BlockChangeFlag flag) Creates a "physics aware" variation of aVolumeApplicatorthat appliesBlockStateswith side effects in accordance with the passed inBlockChangeFlag.static <M extends EntityVolume.Modifiable<M>>
VolumeApplicator<M, Entity, Boolean> A potentially usefulVolumeApplicatorthat attempts to apply aEntityonto a targetEntityVolume, returningbooleanwhether the entity was successfully spawned.static <M extends EntityVolume.Modifiable<M> & LocationCreator<? extends @NonNull Object,? extends ServerLocation>>
VolumeApplicator<M, EntityArchetype, Optional<? extends Entity>> static <M extends EntityArchetypeVolume.Modifiable<M>>
VolumeApplicator<M, EntityArchetype, Boolean> static <M extends BlockEntityVolume.Modifiable<M>>
VolumeApplicator<M, Optional<? extends BlockEntity>, Boolean> A potentially usefulVolumeApplicatorthat conditionally adds or removes aBlockEntity/BlockStatebased on the element'sOptionalstate of beingOptional.empty()orOptional.isPresent().static <M extends BlockVolume.Modifiable<M>>
VolumeApplicator<M, Optional<BlockState>, Boolean> A potentially usefulVolumeApplicatorthat conditionally adds or removes aBlockStatebased on the element'sOptionalstate of beingOptional.empty()orOptional.isPresent().static <M extends PhysicsAwareMutableBlockVolume<M>>
VolumeApplicator<M, Optional<BlockState>, Boolean> A potentially usefulVolumeApplicatorthat conditionally adds or removes aBlockStatebased on the element'sOptionalstate of beingOptional.empty()orOptional.isPresent().
-
Method Details
-
applyBlocks
public static <M extends BlockVolume.Modifiable<M>> VolumeApplicator<M,BlockState, applyBlocks()Boolean> A standardVolumeApplicatorthat applies aBlockStateto anyBlockVolume.Modifiable.Note that this has a different side effect compared to
applyBlocks(BlockChangeFlag)if the targetvolumeis aPhysicsAwareMutableBlockVolumedue to the nature of applying blocks with aBlockChangeFlag. It can be expected that applying blocks directly with this applicator will likely result in side effects playing out to their full extent per block changed.- Type Parameters:
M- The type of modifiable block volume- Returns:
- A blockstate based VolumeApplicator
-
applyBlocks
public static <M extends PhysicsAwareMutableBlockVolume<M>> VolumeApplicator<M,BlockState, applyBlocksBoolean> (BlockChangeFlag flag) Creates a "physics aware" variation of aVolumeApplicatorthat appliesBlockStateswith side effects in accordance with the passed inBlockChangeFlag.- Type Parameters:
M- The target volume type that accepts a BlockChangeFlag- Parameters:
flag- The respective change flag to signal what side effects to play out on application- Returns:
- A blockstate based VolumeApplicator
-
applyBlockEntities
public static <M extends BlockEntityVolume.Modifiable<M>> VolumeApplicator<M,BlockEntity, applyBlockEntities()Boolean> A generic applicator to add aBlockEntityto a targetvolume. This does have the best intention of attempting to set the target's containerBlockStateprior to adding theBlockEntity.- Type Parameters:
M- The type of modifiable volume- Returns:
- An applicator to add block entities
-
applyOrRemoveBlockEntities
public static <M extends BlockEntityVolume.Modifiable<M>> VolumeApplicator<M,Optional<? extends BlockEntity>, applyOrRemoveBlockEntities()Boolean> A potentially usefulVolumeApplicatorthat conditionally adds or removes aBlockEntity/BlockStatebased on the element'sOptionalstate of beingOptional.empty()orOptional.isPresent().- Type Parameters:
M- The type of modifiable block entity volume- Returns:
- An applicator that conditionally adds block entities or removes blocks
-
applyOrRemoveBlockState
public static <M extends BlockVolume.Modifiable<M>> VolumeApplicator<M,Optional<BlockState>, applyOrRemoveBlockState()Boolean> A potentially usefulVolumeApplicatorthat conditionally adds or removes aBlockStatebased on the element'sOptionalstate of beingOptional.empty()orOptional.isPresent().- Type Parameters:
M- The type of modifiable block volume- Returns:
- An applicator that conditionally sets a block or removes a block
-
applyOrRemoveBlockState
public static <M extends PhysicsAwareMutableBlockVolume<M>> VolumeApplicator<M,Optional<BlockState>, applyOrRemoveBlockStateBoolean> (BlockChangeFlag flag) A potentially usefulVolumeApplicatorthat conditionally adds or removes aBlockStatebased on the element'sOptionalstate of beingOptional.empty()orOptional.isPresent(). The added change being the flag- Type Parameters:
M- The type of modifiable block volume- Returns:
- An applicator that conditionally sets a block or removes a block
-
applyBlockEntityArchetype
public static <M extends BlockEntityVolume.Modifiable<M> & LocationCreator<? extends @NonNull Object,? extends ServerLocation>> VolumeApplicator<M,BlockEntityArchetype, applyBlockEntityArchetype()Optional<? extends BlockEntity>> A potentially usefulVolumeApplicatorthat attempts to apply aBlockEntityArchetypeonto a targetBlockEntityVolume, optionally returning a newly placedBlockEntity.- Type Parameters:
M- The type of block entity- Returns:
- A volume applicator that applies block entity archetypes
-
applyBlockEntityArchetypes
public static <M extends BlockEntityArchetypeVolume.Modifiable<M>> VolumeApplicator<M,BlockEntityArchetype, applyBlockEntityArchetypes()Boolean> A potentially usefulVolumeApplicatorthat attempts to apply aBlockEntityArchetypeonto a targetBlockEntityVolume, optionally returning a newly placedBlockEntity.- Type Parameters:
M- The type of block entity- Returns:
- A volume applicator that applies block entity archetypes
-
applyEntities
public static <M extends EntityVolume.Modifiable<M>> VolumeApplicator<M,Entity, applyEntities()Boolean> A potentially usefulVolumeApplicatorthat attempts to apply aEntityonto a targetEntityVolume, returningbooleanwhether the entity was successfully spawned.- Type Parameters:
M- The type of entity volume- Returns:
- A volume applicator that applies entities to volumes
-
applyBiomes
A potentially usefulVolumeApplicatorthat attempts to apply aBiomeonto a targetBiomeVolume, returningbooleanwhether the biome was successfully set.- Type Parameters:
M- The type of biome volume- Returns:
- A volume applicator that applies biomes to volumes
-
applyEntityArchetype
public static <M extends EntityVolume.Modifiable<M> & LocationCreator<? extends @NonNull Object,? extends ServerLocation>> VolumeApplicator<M,EntityArchetype, applyEntityArchetype()Optional<? extends Entity>> -
applyEntityArchetypes
public static <M extends EntityArchetypeVolume.Modifiable<M>> VolumeApplicator<M,EntityArchetype, applyEntityArchetypes()Boolean>
-