Package com.plotsquared.core.util
Class SchematicHandler
java.lang.Object
com.plotsquared.core.util.SchematicHandler
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSchematicHandler(@NonNull WorldUtil worldUtil, @NonNull ProgressSubscriberFactory subscriberFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompletableFuture<com.sk89q.jnbt.CompoundTag> getCompoundTag(@NonNull Plot plot) Get the given plot asCompoundTagmatching the Sponge schematic format.@NonNull CompletableFuture<com.sk89q.jnbt.CompoundTag> getCompoundTag(@NonNull String worldName, @NonNull Set<com.sk89q.worldedit.regions.CuboidRegion> regions) Get the contents of the given regions in the given world asCompoundTagmatching the Sponge schematic format.Deprecated, for removal: This API element is subject to removal in a future version.getSchematic(File file) Get a schematicgetSchematic(String name) Get a schematicgetSchematic(@NonNull URL url) Get an immutable collection containing all schematic namesvoidpaste(Schematic schematic, Plot plot, int xOffset, int yOffset, int zOffset, boolean autoHeight, PlotPlayer<?> actor, RunnableVal<Boolean> whenDone) Paste a schematic.abstract booleanrestoreTile(QueueCoordinator queue, com.sk89q.jnbt.CompoundTag tag, int x, int y, int z) booleanSaves a schematic to a file path.voidupload(com.sk89q.jnbt.CompoundTag tag, UUID uuid, String file, RunnableVal<URL> whenDone) Deprecated, for removal: This API element is subject to removal in a future version.static voidupload(@Nullable UUID uuid, @Nullable String file, @NonNull String extension, @Nullable RunnableVal<OutputStream> writeTask, @NonNull RunnableVal<URL> whenDone) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
manager
-
-
Constructor Details
-
SchematicHandler
@Inject public SchematicHandler(@NonNull WorldUtil worldUtil, @NonNull ProgressSubscriberFactory subscriberFactory)
-
-
Method Details
-
upload
@Deprecated(forRemoval=true, since="6.0.0") public static void upload(@Nullable UUID uuid, @Nullable String file, @NonNull String extension, @Nullable RunnableVal<OutputStream> writeTask, @NonNull RunnableVal<URL> whenDone) Deprecated, for removal: This API element is subject to removal in a future version. -
exportAll
-
paste
public void paste(Schematic schematic, Plot plot, int xOffset, int yOffset, int zOffset, boolean autoHeight, PlotPlayer<?> actor, RunnableVal<Boolean> whenDone) Paste a schematic.- Parameters:
schematic- the schematic object to pasteplot- plot to paste inxOffset- offset x to paste it from plot originyOffset- offset y to paste it from plot originzOffset- offset z to paste it from plot originautoHeight- if to automatically choose height to paste fromactor- the actor pasting the schematicwhenDone- task to run when schematic is pasted
-
restoreTile
public abstract boolean restoreTile(QueueCoordinator queue, com.sk89q.jnbt.CompoundTag tag, int x, int y, int z) -
getSchematic
Get a schematic- Parameters:
name- to check- Returns:
- schematic if found, else null
- Throws:
SchematicHandler.UnsupportedFormatException- thrown if schematic format is unsupported
-
getSchematicNames
Get an immutable collection containing all schematic names- Returns:
- Immutable collection with schematic names
-
getSchematic
Get a schematic- Parameters:
file- to check- Returns:
- schematic if found, else null
- Throws:
SchematicHandler.UnsupportedFormatException- thrown if schematic format is unsupported
-
getSchematic
-
getSchematic
-
getSaves
Deprecated, for removal: This API element is subject to removal in a future version.The legacy web interface is deprecated for removal in favor of Arkitektonika. -
upload
@Deprecated(forRemoval=true, since="6.0.0") public void upload(com.sk89q.jnbt.CompoundTag tag, UUID uuid, String file, RunnableVal<URL> whenDone) Deprecated, for removal: This API element is subject to removal in a future version. -
save
Saves a schematic to a file path.- Parameters:
tag- to savepath- to save in- Returns:
trueif succeeded
-
getCompoundTag
Get the given plot asCompoundTagmatching the Sponge schematic format.- Parameters:
plot- The plot to get the contents from.- Returns:
- a
CompletableFuturethat provides the createdCompoundTag.
-
getCompoundTag
public @NonNull CompletableFuture<com.sk89q.jnbt.CompoundTag> getCompoundTag(@NonNull String worldName, @NonNull Set<com.sk89q.worldedit.regions.CuboidRegion> regions) Get the contents of the given regions in the given world asCompoundTagmatching the Sponge schematic format.- Parameters:
worldName- The world to get the contents from.regions- The regions to get the contents from.- Returns:
- a
CompletableFuturethat provides the createdCompoundTag.
-