Class StructureLoaderAbstractImpl<L,V>
java.lang.Object
com.github.shynixn.structureblocklib.core.entity.StructureLoaderAbstractImpl<L,V>
- All Implemented Interfaces:
com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V>
public class StructureLoaderAbstractImpl<L,V>
extends Object
implements com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V>
-
Constructor Summary
ConstructorsConstructorDescriptionStructureLoaderAbstractImpl(com.github.shynixn.structureblocklib.api.service.ProxyService proxyService, com.github.shynixn.structureblocklib.api.service.StructureSerializationService serializationService, com.github.shynixn.structureblocklib.api.service.StructureWorldService worldService) Creates a new raw structure load instance. -
Method Summary
Modifier and TypeMethodDescriptionSets the target Location corner where the blocks start to get placed.floatGets the target integrity.Gets the target Location.com.github.shynixn.structureblocklib.api.enumeration.StructureMirrorGets the target mirror type.com.github.shynixn.structureblocklib.api.enumeration.StructureRotationGets the target rotation type.longgetSeed()Gets the target seed.includeEntities(boolean enabled) Should entities which may or may not be included in the saved file be included in the loaded structure.integrity(float integrity) Sets the target integrity.booleanShould entities which may or may not be included in the saved file be included in the loaded structure.@NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void>loadFromFile(@NotNull File source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.@NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void>loadFromInputStream(@NotNull InputStream source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.@NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void>loadFromPath(@NotNull Path source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.@NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void>loadFromSaver(@NotNull com.github.shynixn.structureblocklib.api.entity.StructureSaverAbstract<L, V> source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.@NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void>loadFromString(@NotNull String source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.@NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void>loadFromWorld(@NotNull String worldName, @NotNull String author, @NotNull String name) Loads the structure blocks and entities from the structure storage inside each world folder of Minecraft and places the blocks at the defined position.mirror(com.github.shynixn.structureblocklib.api.enumeration.StructureMirror mirror) Sets the target mirror type.rotation(com.github.shynixn.structureblocklib.api.enumeration.StructureRotation rotation) Sets the target rotation type.seed(long seed) Sets the target seed.
-
Constructor Details
-
StructureLoaderAbstractImpl
public StructureLoaderAbstractImpl(com.github.shynixn.structureblocklib.api.service.ProxyService proxyService, com.github.shynixn.structureblocklib.api.service.StructureSerializationService serializationService, com.github.shynixn.structureblocklib.api.service.StructureWorldService worldService) Creates a new raw structure load instance.- Parameters:
proxyService- dependency.serializationService- dependency.worldService- dependency.
-
-
Method Details
-
getLocation
Gets the target Location. -
isIncludeEntitiesEnabled
public boolean isIncludeEntitiesEnabled()Should entities which may or may not be included in the saved file be included in the loaded structure. Default false. -
getMirrorType
public com.github.shynixn.structureblocklib.api.enumeration.StructureMirror getMirrorType()Gets the target mirror type. Default StructureMirror.NONE. -
getRotationType
public com.github.shynixn.structureblocklib.api.enumeration.StructureRotation getRotationType()Gets the target rotation type. Default StructureRotation.NONE. -
getIntegrity
public float getIntegrity()Gets the target integrity. Default 1.0. 1.0 -> Every block which is present in the structure file is placed in the world. smnaller 1.0 -> Blocks get randomly removed by loading depending on the givengetSeed. -
getSeed
public long getSeed()Gets the target seed. Default 0L. The seed is used to randomly remove blocks if the integritygetIntegrityis less than 1.0. -
at
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V> at(@Nullable L location) Sets the target Location corner where the blocks start to get placed. Required parameter. -
includeEntities
public com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V> includeEntities(boolean enabled) Should entities which may or may not be included in the saved file be included in the loaded structure. Default false. -
mirror
public com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V> mirror(com.github.shynixn.structureblocklib.api.enumeration.StructureMirror mirror) Sets the target mirror type. Default StructureMirror.NONE. -
rotation
public com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V> rotation(com.github.shynixn.structureblocklib.api.enumeration.StructureRotation rotation) Sets the target rotation type. Default StructureRotation.NONE. -
integrity
public com.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V> integrity(float integrity) Sets the target integrity. Default 1.0. 1.0 -> Every block which is present in the structure file is placed in the world. smaller 1.0 -> Blocks get randomly removed by loading depending on the givensetSeed. -
seed
Sets the target seed. Default 0L. The seed is used to randomly remove blocks if the integritysetIntegrityis less than 1.0. -
loadFromSaver
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void> loadFromSaver(@NotNull @NotNull com.github.shynixn.structureblocklib.api.entity.StructureSaverAbstract<L, V> source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks. -
loadFromWorld
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void> loadFromWorld(@NotNull @NotNull String worldName, @NotNull @NotNull String author, @NotNull @NotNull String name) Loads the structure blocks and entities from the structure storage inside each world folder of Minecraft and places the blocks at the defined position.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.- Specified by:
loadFromWorldin interfacecom.github.shynixn.structureblocklib.api.entity.StructureLoaderAbstract<L,V> - Parameters:
worldName- World where the structure file is stored.author- Name of the structure author.name- Name of the stored structure.- Returns:
- NotNull instance of
ProgressToken.
-
loadFromString
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void> loadFromString(@NotNull @NotNull String source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks. -
loadFromPath
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void> loadFromPath(@NotNull @NotNull Path source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks. -
loadFromFile
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void> loadFromFile(@NotNull @NotNull File source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks. -
loadFromInputStream
@NotNull public @NotNull com.github.shynixn.structureblocklib.api.entity.ProgressToken<Void> loadFromInputStream(@NotNull @NotNull InputStream source) Loads the structure blocks and entities from the given source and places the blocks at the defined position.This call does not block and finishes in the future. Use
ProgressToken()} for cancellation or callbacks.
-