Stores WorldEdit undo history for the \\undo command.

Type Parameters

  • ClipboardID extends string = string

    The ID of this undo clipboard.

Constructors

Properties

clipboardID: ClipboardID

The ID of this undo clipboard.

Accessors

  • get ids(): `undoclipboard:${ClipboardID};${number},${number},${number},${number}`[]

    The structure IDs of all of the saves of this undo clipboard.

    Returns `undoclipboard:${ClipboardID};${number},${number},${number},${number}`[]

  • get newestSaveTime(): undefined | number

    The newest save time, or undefined if there are no saves.

    Returns undefined | number

  • get saves(): `undoclipboard:${ClipboardID};${number}`[]

    The saves of this undo clipboard.

    Returns `undoclipboard:${ClipboardID};${number}`[]

  • get saveTimes(): number[]

    The save times of this undo clipboard.

    Returns number[]

Methods

  • Removes all items from this undo clipboard.

    Returns void

  • Removes all items from this undo clipboard with the specified timestamp.

    Parameters

    • timestamp: string | number

      The timestamp of the save to remove.

    Returns void

  • Removes all items from this undo clipboard that do not have a corresponding structure.

    Returns void

  • Gets the location and dimension of the specified save of this undo clipboard.

    Parameters

    • timestamp: string | number

      The timestamp of the save to get the location of.

    Returns DimensionLocation

    The location and dimension of the specified save of this undo clipboard.

  • Gets the size of this undo clipboard.

    Parameters

    • timestamp: string | number

      The timestamp of the save to get the size of.

    Returns Vector3

    The size of this undo clipboard.

  • Saves the specified area to this undo clipboard.

    Parameters

    • dimension: Dimension

      The dimension of the area to save to the clipboard.

    • area: { from: Vector3; to: Vector3 }

      The area to save to the clipboard.

    • OptionalsaveTime: number = ...

      The time that the action this undo is for took place.

    • Optionaloptions: StructureCreateOptions

      The options to save the area to the clipboard with.

    • OptionalsizeLimits: Vector3 = ...

      The maximum size of the area to save to the clipboard.

    Returns void

  • The structure IDs of the specified save of this undo clipboard.

    Type Parameters

    • Timestamp extends string | number

      The timestamp of the save to get the structure IDs of.

    Parameters

    • timestamp: Timestamp

      The timestamp of the save to get the structure IDs of.

    Returns `undoclipboard:${ClipboardID};${Timestamp},${number},${number},${number}`[]

    The structure IDs of the specified save of this undo clipboard.

  • Undoes the action saved at the specified time.

    Parameters

    • OptionalsaveTime: number = ...

      The time that the action this undo is for took place. Defaults to the newest save.

    • Optionaloptions: StructurePlaceOptions

      The options to undo the action with.

    • OptionalclearSave: boolean = true

      Whether to clear the save after undoing it. Defaults to true.

    • Optionalsizes: Vector3 = ...

      The sizes of the chunks of the clipboard. Defaults to { x: 64, y: 128, z: 64 }.

    Returns 0 | 1

    1 if the action was undone, 0 if the action was not found.

  • Undoes the action saved at the specified time asynchronously.

    Parameters

    • OptionalsaveTime: number = ...

      The time that the action this undo is for took place. Defaults to the newest save.

    • Optionaloptions: StructurePlaceOptions

      The options to undo the action with.

    • OptionalclearSave: boolean = true

      Whether to clear the save after undoing it. Defaults to true.

    • Optionalsizes: Vector3 = ...

      The sizes of the chunks of the clipboard. Defaults to { x: 64, y: 128, z: 64 }.

    • OptionalminMSBetweenTickWaits: number = config.system.defaultMinMSBetweenTickWaits

      The minimum number of milliseconds between tick waits. Defaults to config.system.defaultMinMSBetweenTickWaits.

    Returns Promise<0 | 1>

    A promise that resolves to 1 if the action was undone or 0 if the action was not found.

  • Clears the contents of all undo clipboards.

    Returns void

  • Removes all items from all undo clipboards that do not have a corresponding structure.

    Returns void

  • Gets all undo clipboard IDs.

    Returns string[]

    An array of all of this undo clipboard IDs.

  • Gets undo clipboards by their IDs.

    Type Parameters

    • ClipboardIDs extends string[]

      The IDs of this undo clipboards to get.

    Parameters

    • clipboardIDs: ClipboardIDs

      The IDs of this undo clipboards to get.

    Returns {
        [K in string | number | symbol]: Globals.modules.coords.UndoClipboard<
            ClipboardIDs[K<K>],
        >
    }

    An array of this undo clipboards with the specified IDs.

    If any of this undo clipboard IDs contain a comma.

  • Gets all save times from all undo clipboards.

    Returns { clipboardID: string; saveTime: number }[]

    An array of all save times from all undo clipboards.

  • Undoes the last action on all undo clipboards.

    Parameters

    • Optionaloptions: StructurePlaceOptions

      The options to undo the action with.

    • OptionalclearSave: boolean = true

      Whether to clear the save after undoing it. Defaults to true.

    • Optionalsizes: Vector3 = ...

      The sizes of the chunks of the clipboard. Defaults to { x: 64, y: 128, z: 64 }.

    Returns 0 | 1

    1 if the action was undone, 0 if the action was not found.

  • Undoes the last action from any of the undo clipboards asynchronously.

    Parameters

    • Optionaloptions: StructurePlaceOptions

      The options to undo the action with.

    • OptionalclearSave: boolean = true

      Whether to clear the save after undoing it. Defaults to true.

    • Optionalsizes: Vector3 = ...

      The sizes of the chunks of the clipboard. Defaults to { x: 64, y: 128, z: 64 }.

    • OptionalminMSBetweenTickWaits: number = config.system.defaultMinMSBetweenTickWaits

      The minimum number of milliseconds between tick waits. Defaults to config.system.defaultMinMSBetweenTickWaits.

    Returns Promise<0 | 1>

    A promise that resolves to 1 if the action was undone or 0 if the action was not found.