mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-21 04:49:51 +08:00
Bypass history for undo/redo.
This commit is contained in:
parent
b2d1562595
commit
6985ff5250
@ -521,25 +521,25 @@ public void rememberChange(Vector position, BaseBlock existing, BaseBlock block)
|
||||
/**
|
||||
* Restores all blocks to their initial state.
|
||||
*
|
||||
* @param sess a new {@link EditSession} to perform the undo in
|
||||
* @param editSession a new {@link EditSession} to perform the undo in
|
||||
*/
|
||||
public void undo(EditSession sess) {
|
||||
public void undo(EditSession editSession) {
|
||||
UndoContext context = new UndoContext();
|
||||
context.setExtent(sess);
|
||||
context.setExtent(editSession.bypassHistory);
|
||||
OperationHelper.completeBlindly(ChangeSetExecutor.createUndo(changeSet, context));
|
||||
sess.flushQueue();
|
||||
editSession.flushQueue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets to new state.
|
||||
*
|
||||
* @param sess a new {@link EditSession} to perform the redo in
|
||||
* @param editSession a new {@link EditSession} to perform the redo in
|
||||
*/
|
||||
public void redo(EditSession sess) {
|
||||
public void redo(EditSession editSession) {
|
||||
UndoContext context = new UndoContext();
|
||||
context.setExtent(sess);
|
||||
context.setExtent(editSession.bypassHistory);
|
||||
OperationHelper.completeBlindly(ChangeSetExecutor.createRedo(changeSet, context));
|
||||
sess.flushQueue();
|
||||
editSession.flushQueue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user