Class BlockChange
java.lang.Object
com.sk89q.worldedit.history.change.BlockChange
- All Implemented Interfaces:
Change
Represents a block change that may be undone or replayed.
This block change does not have an Extent
assigned to it because
one will be taken from the passed UndoContext
. If the context
does not have an extent (it is null), cryptic errors may occur.
-
Constructor Summary
ConstructorDescriptionBlockChange
(BlockVector3 position, BP previous, BC current) Create a new block change. -
Method Summary
Modifier and TypeMethodDescriptionGet the current block.Get the position.Get the previous block.void
redo
(UndoContext context) Perform an redo.void
undo
(UndoContext context) Perform an undo.
-
Constructor Details
-
BlockChange
Create a new block change.- Parameters:
position
- the positionprevious
- the previous blockcurrent
- the current block
-
-
Method Details
-
getPosition
Get the position.- Returns:
- the position
-
getPrevious
Get the previous block.- Returns:
- the previous block
-
getCurrent
Get the current block.- Returns:
- the current block
-
undo
Description copied from interface:Change
Perform an undo. This method may not be available if the object was returned fromChangeSet.forwardIterator()
.- Specified by:
undo
in interfaceChange
- Parameters:
context
- a context for undo- Throws:
WorldEditException
- on an error
-
redo
Description copied from interface:Change
Perform an redo. This method may not be available if the object was returned fromChangeSet.backwardIterator()
()}.- Specified by:
redo
in interfaceChange
- Parameters:
context
- a context for redo- Throws:
WorldEditException
- on an error
-