Package com.plotsquared.core.util
Class SchematicHandler
java.lang.Object
com.plotsquared.core.util.SchematicHandler
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSchematicHandler
(@NonNull WorldUtil worldUtil, @NonNull ProgressSubscriberFactory subscriberFactory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getCompoundTag
(@NonNull Plot plot) Get the given plot asCompoundTag
matching the Sponge schematic format.getCompoundTag
(@NonNull String worldName, @NonNull Set<CuboidRegion> regions) Get the contents of the given regions in the given world asCompoundTag
matching the Sponge schematic format.Deprecated, for removal: This API element is subject to removal in a future version.getSchematic
(@NonNull URL url) getSchematic
(File file) Get a schematicgetSchematic
(String name) Get a schematicGet an immutable collection containing all schematic namesvoid
paste
(Schematic schematic, Plot plot, int xOffset, int yOffset, int zOffset, boolean autoHeight, PlotPlayer<?> actor, RunnableVal<Boolean> whenDone) Paste a schematic.abstract boolean
restoreTile
(QueueCoordinator queue, CompoundTag tag, int x, int y, int z) boolean
save
(CompoundTag tag, String path) Saves a schematic to a file path.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.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.
-
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
-
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(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:
true
if succeeded
-
getCompoundTag
Get the given plot asCompoundTag
matching the Sponge schematic format.- Parameters:
plot
- The plot to get the contents from.- Returns:
- a
CompletableFuture
that 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 asCompoundTag
matching the Sponge schematic format.- Parameters:
worldName
- The world to get the contents from.regions
- The regions to get the contents from.- Returns:
- a
CompletableFuture
that provides the createdCompoundTag
.
-