Skip to content
Browse files

Revert "Made //undo and //redo disregard global masks."

This does nothing and neither did the original code. Disregard previous notice.
This reverts commit cfb19eb.
  • Loading branch information...
1 parent 7eac40c commit 6c6f965ac79cbad84ca82e0287fa11723a0a6e62 @wizjany wizjany committed Mar 2, 2013
Showing with 2 additions and 16 deletions.
  1. +2 −16 src/main/java/com/sk89q/worldedit/commands/HistoryCommands.java
View
18 src/main/java/com/sk89q/worldedit/commands/HistoryCommands.java
@@ -23,7 +23,6 @@
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandPermissions;
import com.sk89q.worldedit.*;
-import com.sk89q.worldedit.masks.Mask;
/**
* History little commands.
@@ -47,12 +46,8 @@ public HistoryCommands(WorldEdit we) {
@CommandPermissions("worldedit.history.undo")
public void undo(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
-
+
int times = Math.max(1, args.getInteger(0, 1));
-
- Mask mask = session.getMask();
- session.setMask(null);
-
for (int i = 0; i < times; ++i) {
EditSession undone;
if (args.argsLength() < 2) {
@@ -66,7 +61,6 @@ public void undo(CommandContext args, LocalSession session, LocalPlayer player,
}
undone = sess.undo(session.getBlockBag(player), player);
}
-
if (undone != null) {
player.print("Undo successful.");
we.flushBlockBag(player, undone);
@@ -75,8 +69,6 @@ public void undo(CommandContext args, LocalSession session, LocalPlayer player,
break;
}
}
-
- session.setMask(mask);
}
@Command(
@@ -89,12 +81,9 @@ public void undo(CommandContext args, LocalSession session, LocalPlayer player,
@CommandPermissions("worldedit.history.redo")
public void redo(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
-
+
int times = Math.max(1, args.getInteger(0, 1));
- Mask mask = session.getMask();
- session.setMask(null);
-
for (int i = 0; i < times; ++i) {
EditSession redone;
if (args.argsLength() < 2) {
@@ -108,16 +97,13 @@ public void redo(CommandContext args, LocalSession session, LocalPlayer player,
}
redone = sess.redo(session.getBlockBag(player), player);
}
-
if (redone != null) {
player.print("Redo successful.");
we.flushBlockBag(player, redone);
} else {
player.printError("Nothing left to redo.");
}
}
-
- session.setMask(mask);
}
@Command(

0 comments on commit 6c6f965

Please sign in to comment.
Something went wrong with that request. Please try again.