public class BlockChange extends java.lang.Object implements Change
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 and Description |
---|
BlockChange(BlockVector3 position,
BlockStateHolder previous,
BlockStateHolder current)
Create a new block change.
|
Modifier and Type | Method and Description |
---|---|
BlockStateHolder |
getCurrent()
Get the current block.
|
BlockVector3 |
getPosition()
Get the position.
|
BlockStateHolder |
getPrevious()
Get the previous block.
|
void |
redo(UndoContext context)
Perform an redo.
|
void |
undo(UndoContext context)
Perform an undo.
|
public BlockChange(BlockVector3 position, BlockStateHolder previous, BlockStateHolder current)
position
- the positionprevious
- the previous blockcurrent
- the current blockpublic BlockVector3 getPosition()
public BlockStateHolder getPrevious()
public BlockStateHolder getCurrent()
public void undo(UndoContext context) throws WorldEditException
Change
ChangeSet.forwardIterator()
.undo
in interface Change
context
- a context for undoWorldEditException
- on an errorpublic void redo(UndoContext context) throws WorldEditException
Change
ChangeSet.backwardIterator()
()}.redo
in interface Change
context
- a context for redoWorldEditException
- on an error