Interface PlacementContext<C>
- Type Parameters:
C- the feature's configuration type
The placement surface handed to a CustomFeature during world generation.
- Since:
- 2.3.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanaddFreshEntity(Entity entity) Adds a new entity to the world.booleanaddFreshEntity(Entity entity, @Nullable CreatureSpawnEvent.SpawnReason reason) Adds a new entity to the world.config()The feature's configuration.default booleandestroyBlock(BlockVector position, boolean dropResources) Destroys a block at the given absolute world position.default booleandestroyBlock(BlockVector position, boolean dropResources, @Nullable Entity breaker) Destroys a block at the given absolute world position.booleandestroyBlock(BlockVector position, boolean dropResources, @Nullable Entity breaker, int updateLimit) Destroys a block at the given absolute world position.getBlock(BlockVector position) Gets the block data at the given absolute world position.origin()The world origin of this feature placement.random()A random source seeded for this placement.default booleanremoveBlock(BlockVector position) Removes a block at the given absolute world position.booleanremoveBlock(BlockVector position, boolean movedByPiston) Removes a block at the given absolute world position.voidsetBlock(BlockVector position, BlockData data) Sets a block at the given absolute world position.
-
Field Details
-
BLOCK_UPDATE_LIMIT
static final int BLOCK_UPDATE_LIMIT- See Also:
-
-
Method Details
-
config
-
random
-
origin
The world origin of this feature placement.- Returns:
- the origin as a BlockVector
- Since:
- 2.3.0
-
setBlock
Sets a block at the given absolute world position.- Parameters:
position- the absolute world positiondata- the block data to place- Since:
- 2.3.0
-
getBlock
Gets the block data at the given absolute world position.- Parameters:
position- the absolute world position- Returns:
- the block data currently at that position
- Since:
- 2.3.0
-
removeBlock
Removes a block at the given absolute world position.- Parameters:
position- the absolute world positionmovedByPiston- whether the block was moved by a piston- Returns:
- whether the block was removed
- Since:
- 2.3.0
-
removeBlock
Removes a block at the given absolute world position.- Parameters:
position- the absolute world position- Returns:
- whether the block was removed
- Since:
- 2.3.0
-
destroyBlock
@AsOf("2.3.0") boolean destroyBlock(BlockVector position, boolean dropResources, @Nullable Entity breaker, int updateLimit) Destroys a block at the given absolute world position.- Parameters:
position- the absolute world positiondropResources- whether to drop resourcesbreaker- the entity that broke the block, if anyupdateLimit- the maximum number of blocks to update- Returns:
- whether the block was destroyed
- Since:
- 2.3.0
-
destroyBlock
@AsOf("2.3.0") default boolean destroyBlock(BlockVector position, boolean dropResources, @Nullable Entity breaker) Destroys a block at the given absolute world position.- Parameters:
position- the absolute world positiondropResources- whether to drop resourcesbreaker- the entity that broke the block, if any- Returns:
- whether the block was destroyed
- Since:
- 2.3.0
-
destroyBlock
Destroys a block at the given absolute world position.- Parameters:
position- the absolute world positiondropResources- whether to drop resources- Returns:
- whether the block was destroyed
- Since:
- 2.3.0
-
addFreshEntity
@AsOf("2.3.0") boolean addFreshEntity(Entity entity, @Nullable CreatureSpawnEvent.SpawnReason reason) Adds a new entity to the world.- Parameters:
entity- the entity to addreason- the reason the entity was spawned- Returns:
- whether the entity was added successfully
- Since:
- 2.3.0
-
addFreshEntity
-