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,
BP previous,
BC current)
Create a new block change.
|
Modifier and Type | Method and Description |
---|---|
BaseBlock |
getCurrent()
Get the current block.
|
BlockVector3 |
getPosition()
Get the position.
|
BaseBlock |
getPrevious()
Get the previous block.
|
void |
redo(UndoContext context)
Perform an redo.
|
void |
undo(UndoContext context)
Perform an undo.
|
public BlockChange(BlockVector3 position, BP previous, BC current)
position
- the positionprevious
- the previous blockcurrent
- the current blockpublic BlockVector3 getPosition()
public BaseBlock getPrevious()
public BaseBlock 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