Fix compile
This commit is contained in:
parent
9002a9a78f
commit
d3ddd9ea6a
|
@ -233,28 +233,29 @@ public class HistoryCommands extends MethodCommands {
|
||||||
public void undo(Player player, LocalSession session, CommandContext context) throws WorldEditException {
|
public void undo(Player player, LocalSession session, CommandContext context) throws WorldEditException {
|
||||||
int times = Math.max(1, context.getInteger(0, 1));
|
int times = Math.max(1, context.getInteger(0, 1));
|
||||||
if (times > 50) {
|
if (times > 50) {
|
||||||
FawePlayer.wrap(player).checkConfirmation(getArguments(context), times, 50);
|
FawePlayer.wrap(player).checkConfirmation(() -> {
|
||||||
}
|
for (int i = 0; i < times; ++i) {
|
||||||
for (int i = 0; i < times; ++i) {
|
EditSession undone;
|
||||||
EditSession undone;
|
if (context.argsLength() < 2) {
|
||||||
if (context.argsLength() < 2) {
|
undone = session.undo(session.getBlockBag(player), player);
|
||||||
undone = session.undo(session.getBlockBag(player), player);
|
} else {
|
||||||
} else {
|
player.checkPermission("worldedit.history.undo.other");
|
||||||
player.checkPermission("worldedit.history.undo.other");
|
LocalSession sess = worldEdit.getSession(context.getString(1));
|
||||||
LocalSession sess = worldEdit.getSession(context.getString(1));
|
if (sess == null) {
|
||||||
if (sess == null) {
|
BBC.COMMAND_HISTORY_OTHER_ERROR.send(player, context.getString(1));
|
||||||
BBC.COMMAND_HISTORY_OTHER_ERROR.send(player, context.getString(1));
|
break;
|
||||||
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);
|
}, getArguments(context), times, 50);
|
||||||
}
|
|
||||||
if (undone != null) {
|
|
||||||
BBC.COMMAND_UNDO_SUCCESS.send(player);
|
|
||||||
worldEdit.flushBlockBag(player, undone);
|
|
||||||
} else {
|
|
||||||
BBC.COMMAND_UNDO_ERROR.send(player);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue