Class SchematicHandler

java.lang.Object
com.plotsquared.core.util.SchematicHandler

public abstract class SchematicHandler extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • upload

      @Deprecated(forRemoval=true) 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 paste
      plot - plot to paste in
      xOffset - offset x to paste it from plot origin
      yOffset - offset y to paste it from plot origin
      zOffset - offset z to paste it from plot origin
      autoHeight - if to automatically choose height to paste from
      actor - the actor pasting the schematic
      whenDone - 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

      public Schematic getSchematic(String name) throws SchematicHandler.UnsupportedFormatException
      Get a schematic
      Parameters:
      name - to check
      Returns:
      schematic if found, else null
      Throws:
      SchematicHandler.UnsupportedFormatException - thrown if schematic format is unsupported
    • getSchematicNames

      public Collection<String> getSchematicNames()
      Get an immutable collection containing all schematic names
      Returns:
      Immutable collection with schematic names
    • getSchematic

      public Schematic getSchematic(File file) throws SchematicHandler.UnsupportedFormatException
      Get a schematic
      Parameters:
      file - to check
      Returns:
      schematic if found, else null
      Throws:
      SchematicHandler.UnsupportedFormatException - thrown if schematic format is unsupported
    • getSchematic

      public Schematic getSchematic(@NonNull URL url)
    • getSchematic

      public Schematic getSchematic(@NonNull InputStream is)
    • getSaves

      public List<String> getSaves(UUID uuid)
    • upload

      @Deprecated(forRemoval=true) 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

      public boolean save(com.sk89q.jnbt.CompoundTag tag, String path)
      Saves a schematic to a file path.
      Parameters:
      tag - to save
      path - to save in
      Returns:
      true if succeeded
    • getCompoundTag

      public CompletableFuture<com.sk89q.jnbt.CompoundTag> getCompoundTag(@NonNull Plot plot)
      Get the given plot as CompoundTag matching the Sponge schematic format.
      Parameters:
      plot - The plot to get the contents from.
      Returns:
      a CompletableFuture that provides the created CompoundTag.
    • 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 as CompoundTag 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 created CompoundTag.