Interface StructureSaverAbstract<L,V>
public interface StructureSaverAbstract<L,V>
Interface fluent API to save structures from the world into
different targets.
-
Method Summary
Modifier and TypeMethodDescription@NotNull StructureSaverAbstract<L,V> Sets the source Location corner where the blocks start to get saved.Sets the author.@Nullable StringGets the author.Gets the source Location.Gets the offset of the selection.@NotNull StructureRestrictionGets the size restriction.@NotNull StringDeprecated.includeEntities(boolean enabled) Should entities be included in the save file.booleanShould entities included in the saved file.@NotNull StructureSaverAbstract<L,V> Sets the source Vector offset where the blocks reach to get saved.@NotNull StructureSaverAbstract<L,V> restriction(@NotNull StructureRestriction structureRestriction) Restricts the structure to a certain size if a larger area is selected with offset.@NotNull ProgressToken<Void>saveToFile(@NotNull File target) Saves the blocks and entities from the world into into a structure.nbt file.@NotNull ProgressToken<Void>saveToOutputStream(@NotNull OutputStream target) Saves the blocks and entities from the world into into a structure.nbt binary stream.@NotNull ProgressToken<Void>saveToPath(@NotNull Path target) Saves the blocks and entities from the world into into a structure.nbt file.@NotNull ProgressToken<String>Saves the blocks and entities from the world into into a structure.nbt binary as Base64 encoded string.@NotNull ProgressToken<Void>saveToWorld(@NotNull String worldName, @NotNull String author, @NotNull String name) Saves the blocks and entities from the world into into a structure.nbt file located in the world folder, author folder.@NotNull StructureSaverAbstract<L,V> sizeX(int x) Sets the offset in x coordinate.@NotNull StructureSaverAbstract<L,V> sizeY(int y) Sets the offset in y coordinate.@NotNull StructureSaverAbstract<L,V> sizeZ(int z) Sets the offset in z coordinate.@NotNull StructureSaverAbstract<L,V> structureVoidTypeName(String name) Deprecated.
-
Method Details
-
getLocation
Gets the source Location.- Returns:
- location.
-
getOffset
Gets the offset of the selection. Has to be smaller or equal toStructureRestriction.- Returns:
- offset.
-
getAuthor
Gets the author. The author is a optional meta data in the final structure file.- Returns:
- author.
-
isIncludeEntitiesEnabled
boolean isIncludeEntitiesEnabled()Should entities included in the saved file. Default false.- Returns:
- flag.
-
getRestriction
Gets the size restriction.Default StructureRestriction.SINGLE_32.
- Returns:
- restriction.
-
getStructureVoidTypeName
Deprecated.This internal value is no longer exposed since 1.18.2. -
at
Sets the source Location corner where the blocks start to get saved. Required parameter.- Parameters:
location- Location.- Returns:
- This instance.
-
offSet
Sets the source Vector offset where the blocks reach to get saved. Required parameter.- Parameters:
vector- Vector.- Returns:
- This instance.
-
sizeX
Sets the offset in x coordinate.- Parameters:
x- offset.- Returns:
- This instance.
-
sizeY
Sets the offset in y coordinate.- Parameters:
y- offset.- Returns:
- This instance.
-
sizeZ
Sets the offset in z coordinate.- Parameters:
z- offset.- Returns:
- This instance.
-
author
Sets the author. The author is a optional meta data in the final structure file.- Parameters:
author- name.- Returns:
- This instance.
-
includeEntities
Should entities be included in the save file. Default false.- Parameters:
enabled- Flag.- Returns:
- This instance.
-
restriction
@NotNull @NotNull StructureSaverAbstract<L,V> restriction(@NotNull @NotNull StructureRestriction structureRestriction) Restricts the structure to a certain size if a larger area is selected with offset. Default StructureRestriction.SINGLE_32.- Parameters:
structureRestriction- Restriction.- Returns:
- This instance.
-
structureVoidTypeName
Deprecated.This value is no longer used since 1.18.2. -
saveToWorld
@NotNull @NotNull ProgressToken<Void> saveToWorld(@NotNull @NotNull String worldName, @NotNull @NotNull String author, @NotNull @NotNull String name) Saves the blocks and entities from the world into into a structure.nbt file located in the world folder, author folder. Overrides existing files. This allows to use the structure in Vanilla Structure Blocks.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.- Parameters:
worldName- World where the structure file is stored.author- Author of the structure.name- Name of the stored structure.- Returns:
- Instance of
ProgressToken.
-
saveToString
Saves the blocks and entities from the world into into a structure.nbt binary as Base64 encoded string.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.- Returns:
- Instance of
ProgressTokenwith Base64EncodedString result.
-
saveToPath
Saves the blocks and entities from the world into into a structure.nbt file.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.- Parameters:
target- Non existing or existing file. Overrides existing files.- Returns:
- Instance of
ProgressToken.
-
saveToFile
Saves the blocks and entities from the world into into a structure.nbt file.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.- Parameters:
target- Non existing or existing file. Overrides existing files.- Returns:
- Instance of
ProgressToken.
-
saveToOutputStream
Saves the blocks and entities from the world into into a structure.nbt binary stream.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.- Parameters:
target- Open binary outputStream. Does not close the outputStream.- Returns:
- Instance of
ProgressToken.
-