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 TypeMethodDescriptionbooleangetCompoundTag(@NonNull Plot plot) Get the given plot asCompoundTagmatching the Sponge schematic format.getCompoundTag(@NonNull String worldName, @NonNull Set<CuboidRegion> regions) Get the contents of the given regions in the given world asCompoundTagmatching the Sponge schematic format.getSchematic(@NonNull URL url) getSchematic(File file) Get a schematicgetSchematic(String name) Get a schematicGet 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, CompoundTag tag, int x, int y, int z) booleansave(CompoundTag tag, String path) Saves a schematic to a file path.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.voidupload(CompoundTag tag, UUID uuid, String file, 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
public boolean exportAll(Collection<Plot> collection, File outputDir, String namingScheme, Runnable ifSuccess) -
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
-
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
-
upload
@Deprecated(forRemoval=true, since="6.0.0") public void upload(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<CompoundTag> getCompoundTag(@NonNull String worldName, @NonNull Set<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.
-