mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-19 10:25:00 +00:00
tweak undo message
This commit is contained in:
parent
1a12c065a1
commit
888cbcedee
@ -90,9 +90,9 @@ public enum BBC {
|
|||||||
COMMAND_HISTORY_CLEAR("History cleared", "WorldEdit.History"),
|
COMMAND_HISTORY_CLEAR("History cleared", "WorldEdit.History"),
|
||||||
COMMAND_REDO_ERROR("Nothing left to redo. (See also `/inspect` and `/frb`)", "WorldEdit.History"),
|
COMMAND_REDO_ERROR("Nothing left to redo. (See also `/inspect` and `/frb`)", "WorldEdit.History"),
|
||||||
COMMAND_HISTORY_OTHER_ERROR("Unable to find session for %s0.", "WorldEdit.History"),
|
COMMAND_HISTORY_OTHER_ERROR("Unable to find session for %s0.", "WorldEdit.History"),
|
||||||
COMMAND_REDO_SUCCESS("Redo successful.", "WorldEdit.History"),
|
COMMAND_REDO_SUCCESS("Redo successful%s0.", "WorldEdit.History"),
|
||||||
COMMAND_UNDO_ERROR("Nothing left to undo. (See also `/inspect` and `/frb`)", "WorldEdit.History"),
|
COMMAND_UNDO_ERROR("Nothing left to undo. (See also `/inspect` and `/frb`)", "WorldEdit.History"),
|
||||||
COMMAND_UNDO_SUCCESS("Undo successful.", "WorldEdit.History"),
|
COMMAND_UNDO_SUCCESS("Undo successful%s0.", "WorldEdit.History"),
|
||||||
|
|
||||||
OPERATION("Operation queued (%s0)", "WorldEdit.Operation"),
|
OPERATION("Operation queued (%s0)", "WorldEdit.Operation"),
|
||||||
|
|
||||||
|
@ -226,8 +226,9 @@ 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));
|
||||||
FawePlayer.wrap(player).checkConfirmation(() -> {
|
FawePlayer.wrap(player).checkConfirmation(() -> {
|
||||||
for (int i = 0; i < times; ++i) {
|
EditSession undone = null;
|
||||||
EditSession undone;
|
int i = 0;
|
||||||
|
for (; i < times; ++i) {
|
||||||
if (context.argsLength() < 2) {
|
if (context.argsLength() < 2) {
|
||||||
undone = session.undo(session.getBlockBag(player), player);
|
undone = session.undo(session.getBlockBag(player), player);
|
||||||
} else {
|
} else {
|
||||||
@ -238,14 +239,16 @@ public class HistoryCommands extends MethodCommands {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
undone = sess.undo(session.getBlockBag(player), player);
|
undone = sess.undo(session.getBlockBag(player), player);
|
||||||
|
if (undone == null) break;
|
||||||
}
|
}
|
||||||
if (undone != null) {
|
}
|
||||||
BBC.COMMAND_UNDO_SUCCESS.send(player);
|
if (undone == null) i--;
|
||||||
|
if (i > 0) {
|
||||||
|
BBC.COMMAND_UNDO_SUCCESS.send(player, i == 1 ? "" : " x" + i);
|
||||||
worldEdit.flushBlockBag(player, undone);
|
worldEdit.flushBlockBag(player, undone);
|
||||||
} else {
|
|
||||||
BBC.COMMAND_UNDO_ERROR.send(player);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
if (undone == null) {
|
||||||
|
BBC.COMMAND_UNDO_ERROR.send(player);
|
||||||
}
|
}
|
||||||
}, getArguments(context), times, 50, context);
|
}, getArguments(context), times, 50, context);
|
||||||
}
|
}
|
||||||
@ -262,8 +265,9 @@ public class HistoryCommands extends MethodCommands {
|
|||||||
|
|
||||||
int times = Math.max(1, args.getInteger(0, 1));
|
int times = Math.max(1, args.getInteger(0, 1));
|
||||||
|
|
||||||
for (int i = 0; i < times; ++i) {
|
EditSession redone = null;
|
||||||
EditSession redone;
|
int i = 0;
|
||||||
|
for (; i < times; ++i) {
|
||||||
if (args.argsLength() < 2) {
|
if (args.argsLength() < 2) {
|
||||||
redone = session.redo(session.getBlockBag(player), player);
|
redone = session.redo(session.getBlockBag(player), player);
|
||||||
} else {
|
} else {
|
||||||
@ -274,13 +278,16 @@ public class HistoryCommands extends MethodCommands {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
redone = sess.redo(session.getBlockBag(player), player);
|
redone = sess.redo(session.getBlockBag(player), player);
|
||||||
|
if (redone == null) break;
|
||||||
}
|
}
|
||||||
if (redone != null) {
|
}
|
||||||
BBC.COMMAND_REDO_SUCCESS.send(player);
|
if (redone == null) i--;
|
||||||
|
if (i > 0) {
|
||||||
|
BBC.COMMAND_REDO_SUCCESS.send(player, i == 1 ? "" : " x" + i);
|
||||||
worldEdit.flushBlockBag(player, redone);
|
worldEdit.flushBlockBag(player, redone);
|
||||||
} else {
|
|
||||||
BBC.COMMAND_REDO_ERROR.send(player);
|
|
||||||
}
|
}
|
||||||
|
if (redone == null) {
|
||||||
|
BBC.COMMAND_REDO_ERROR.send(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user