From 8ce757631ac2e4e7670f93975debd20d9c1ffad1 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sun, 27 Jul 2014 22:04:28 -0700 Subject: [PATCH] Fix undo and redo broken by a precondition. --- src/main/java/com/sk89q/worldedit/LocalSession.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/LocalSession.java b/src/main/java/com/sk89q/worldedit/LocalSession.java index 85b02b091..39e7dd3db 100644 --- a/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -198,7 +198,7 @@ public class LocalSession { * @param player the player * @return whether anything was undone */ - public EditSession undo(BlockBag newBlockBag, LocalPlayer player) { + public EditSession undo(@Nullable BlockBag newBlockBag, LocalPlayer player) { return undo(newBlockBag, (Player) player); } @@ -209,8 +209,7 @@ public class LocalSession { * @param player the player * @return whether anything was undone */ - public EditSession undo(BlockBag newBlockBag, Player player) { - checkNotNull(newBlockBag); + public EditSession undo(@Nullable BlockBag newBlockBag, Player player) { checkNotNull(player); --historyPointer; if (historyPointer >= 0) { @@ -234,7 +233,7 @@ public class LocalSession { * @param player the player * @return whether anything was redone */ - public EditSession redo(BlockBag newBlockBag, LocalPlayer player) { + public EditSession redo(@Nullable BlockBag newBlockBag, LocalPlayer player) { return redo(newBlockBag, (Player) player); } @@ -245,8 +244,7 @@ public class LocalSession { * @param player the player * @return whether anything was redone */ - public EditSession redo(BlockBag newBlockBag, Player player) { - checkNotNull(newBlockBag); + public EditSession redo(@Nullable BlockBag newBlockBag, Player player) { checkNotNull(player); if (historyPointer < history.size()) { EditSession editSession = history.get(historyPointer);