This commit is contained in:
Jesse Boyd 2018-09-08 08:23:01 +10:00
parent ca5ffe081b
commit 8da1224e08
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 22 additions and 24 deletions

View File

@ -1051,9 +1051,9 @@ public class MainUtil {
public static void deleteOlder(File directory, final long timeDiff, boolean printDebug) { public static void deleteOlder(File directory, final long timeDiff, boolean printDebug) {
final long now = System.currentTimeMillis(); final long now = System.currentTimeMillis();
ForkJoinPool pool = new ForkJoinPool(); ForkJoinPool pool = new ForkJoinPool();
iterateFiles(directory, new RunnableVal<File>() { iterateFiles(directory, new Consumer<File>() {
@Override @Override
public void run(File file) { public void accept(File file) {
long age = now - file.lastModified(); long age = now - file.lastModified();
if (age > timeDiff) { if (age > timeDiff) {
pool.submit(() -> file.delete()); pool.submit(() -> file.delete());

View File

@ -232,7 +232,6 @@ public class HistoryCommands extends MethodCommands {
@CommandPermissions("worldedit.history.undo") @CommandPermissions("worldedit.history.undo")
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) {
FawePlayer.wrap(player).checkConfirmation(() -> { FawePlayer.wrap(player).checkConfirmation(() -> {
for (int i = 0; i < times; ++i) { for (int i = 0; i < times; ++i) {
EditSession undone; EditSession undone;
@ -240,7 +239,7 @@ public class HistoryCommands extends MethodCommands {
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.getSessionManager().findByName(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;
@ -257,7 +256,6 @@ public class HistoryCommands extends MethodCommands {
} }
}, getArguments(context), times, 50); }, getArguments(context), times, 50);
} }
}
@Command( @Command(
aliases = {"/redo", "redo"}, aliases = {"/redo", "redo"},