Fix compile

This commit is contained in:
Jesse Boyd 2018-09-08 02:07:47 +10:00
parent 9002a9a78f
commit d3ddd9ea6a
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -233,28 +233,29 @@ public class HistoryCommands extends MethodCommands {
public void undo(Player player, LocalSession session, CommandContext context) throws WorldEditException {
int times = Math.max(1, context.getInteger(0, 1));
if (times > 50) {
FawePlayer.wrap(player).checkConfirmation(getArguments(context), times, 50);
}
for (int i = 0; i < times; ++i) {
EditSession undone;
if (context.argsLength() < 2) {
undone = session.undo(session.getBlockBag(player), player);
} else {
player.checkPermission("worldedit.history.undo.other");
LocalSession sess = worldEdit.getSession(context.getString(1));
if (sess == null) {
BBC.COMMAND_HISTORY_OTHER_ERROR.send(player, context.getString(1));
break;
FawePlayer.wrap(player).checkConfirmation(() -> {
for (int i = 0; i < times; ++i) {
EditSession undone;
if (context.argsLength() < 2) {
undone = session.undo(session.getBlockBag(player), player);
} else {
player.checkPermission("worldedit.history.undo.other");
LocalSession sess = worldEdit.getSession(context.getString(1));
if (sess == null) {
BBC.COMMAND_HISTORY_OTHER_ERROR.send(player, context.getString(1));
break;
}
undone = sess.undo(session.getBlockBag(player), player);
}
if (undone != null) {
BBC.COMMAND_UNDO_SUCCESS.send(player);
worldEdit.flushBlockBag(player, undone);
} else {
BBC.COMMAND_UNDO_ERROR.send(player);
break;
}
}
undone = sess.undo(session.getBlockBag(player), player);
}
if (undone != null) {
BBC.COMMAND_UNDO_SUCCESS.send(player);
worldEdit.flushBlockBag(player, undone);
} else {
BBC.COMMAND_UNDO_ERROR.send(player);
break;
}
}, getArguments(context), times, 50);
}
}