Class SnapshotRestore

java.lang.Object
com.sk89q.worldedit.world.snapshot.SnapshotRestore

public class SnapshotRestore extends Object
A snapshot restore operation.
  • Constructor Details

    • SnapshotRestore

      public SnapshotRestore(ChunkStore chunkStore, EditSession editSession, Region region)
      Construct the snapshot restore operation.
      Parameters:
      chunkStore - The ChunkStore to restore from
      editSession - The EditSession to restore to
      region - The Region to restore to
  • Method Details

    • getChunksAffected

      public int getChunksAffected()
      Get the number of chunks that are needed.
      Returns:
      a number of chunks
    • restore

      public void restore() throws MaxChangedBlocksException
      Restores to world.
      Throws:
      MaxChangedBlocksException - if the max block change limit is exceeded
    • getMissingChunks

      public List<BlockVector2> getMissingChunks()
      Get a list of the missing chunks. restore() must have been called already.
      Returns:
      a list of coordinates
    • getErrorChunks

      public List<BlockVector2> getErrorChunks()
      Get a list of the chunks that could not have been loaded for other reasons. restore() must have been called already.
      Returns:
      a list of coordinates
    • hadTotalFailure

      public boolean hadTotalFailure()
      Checks to see where the backup succeeded in any capacity. False will be returned if no chunk could be successfully loaded.
      Returns:
      true if there was total failure
    • getLastErrorMessage

      public String getLastErrorMessage()
      Get the last error message.
      Returns:
      a message