idk it compiles now
This commit is contained in:
Jesse Boyd
2019-08-10 16:01:42 +10:00
parent 3b879477b6
commit 7a57a5dd8c
35 changed files with 310 additions and 312 deletions

View File

@ -165,49 +165,4 @@ public class WEManager {
}
return false;
}
public boolean delay(FawePlayer<?> player, String command) {
final long start = System.currentTimeMillis();
return this.delay(player, () -> {
try {
if (System.currentTimeMillis() - start > 1000) {
BBC.WORLDEDIT_RUN.send(FawePlayer.wrap(player));
}
TaskManager.IMP.task(() -> {
final long start1 = System.currentTimeMillis();
player.executeCommand(command.substring(1));
TaskManager.IMP.later(() -> SetQueue.IMP.addEmptyTask(() -> {
if (System.currentTimeMillis() - start1 > 1000) {
BBC.WORLDEDIT_COMPLETE.send(FawePlayer.wrap(player));
}
}), 2);
});
} catch (Exception e) {
e.printStackTrace();
}
}, false, false);
}
public boolean delay(FawePlayer<?> player, Runnable whenDone, boolean delayed, boolean onlyDelayedExecution) {
final boolean free = SetQueue.IMP.addEmptyTask(null);
if (free) {
if (delayed) {
if (whenDone != null) {
whenDone.run();
}
} else {
if (whenDone != null && !onlyDelayedExecution) {
whenDone.run();
} else {
return false;
}
}
} else {
if (!delayed && player != null) {
BBC.WORLDEDIT_DELAYED.send(player);
}
SetQueue.IMP.addEmptyTask(whenDone);
}
return true;
}
}