Interface StructureManager
public interface StructureManager
Entry point to the datapack structures of the server.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionSearches the nearest start of a structure that world generation would place.placeStructure(World world, BlockPos position, Key structure) Assembles and places a jigsaw structure.placeTemplate(World world, BlockPos origin, Key template, StructureRotation rotation) Pastes a template into a world.reload()Reads the datapacks again.Loads (or returns the cached) template.
-
Method Details
-
datapacks
-
templates
-
template
Loads (or returns the cached) template.- Parameters:
key- the template identifier- Returns:
- the template, empty when unknown or unreadable
-
structures
-
placeTemplate
CompletableFuture<Integer> placeTemplate(World world, BlockPos origin, Key template, StructureRotation rotation) Pastes a template into a world.- Parameters:
world- the target worldorigin- the lowest corner before rotationtemplate- the template identifierrotation- the rotation to apply aroundorigin- Returns:
- the number of blocks written, completed once every chunk has been updated
-
placeStructure
Assembles and places a jigsaw structure. The biome filter of the structure is ignored.- Parameters:
world- the target worldposition- the block whose chunk hosts the structure startstructure- the structure identifier- Returns:
- the number of pieces placed,
0when the structure could not be assembled
-
locate
CompletableFuture<Optional<BlockPos>> locate(World world, BlockPos origin, Key structure, int radiusCells) Searches the nearest start of a structure that world generation would place.- Parameters:
world- the world to searchorigin- the search centrestructure- the structure identifierradiusCells- how many placement cells to scan around the origin- Returns:
- the start position, or empty when none was found in range
-
reload
CompletableFuture<Void> reload()Reads the datapacks again. Chunks generated from now on use the new content; chunks already generated keep what they have.- Returns:
- completed once the new content is live
-