Send fail message on semi-successful edit.

This commit is contained in:
Jesse Boyd 2016-08-28 02:05:54 +10:00
parent c5fc8c6ef8
commit 062c80e7b3
2 changed files with 7 additions and 0 deletions

View File

@ -146,6 +146,8 @@ public enum BBC {
"&8[&cCritical&8] &cDetected low memory i.e. < 1%. FAWE will take the following actions:\n&8 - &7Terminate WE block placement\n&8 - &7Clear WE history\n&8 - &7Unload non essential chunks\n&8 - &7Kill entities\n&8 - &7Garbage collect\n&cIgnore this if trying to crash server.\n&7Note: Low memory is likely (but not necessarily) caused by WE", "&8[&cCritical&8] &cDetected low memory i.e. < 1%. FAWE will take the following actions:\n&8 - &7Terminate WE block placement\n&8 - &7Clear WE history\n&8 - &7Unload non essential chunks\n&8 - &7Kill entities\n&8 - &7Garbage collect\n&cIgnore this if trying to crash server.\n&7Note: Low memory is likely (but not necessarily) caused by WE",
"Error"), "Error"),
WORLDEDIT_SOME_FAILS("&c%s0 blocks weren't placed because they were outside your allowed region.", "Error"),
WORLDEDIT_CANCEL_COUNT("&cCancelled %s0 edits.", "Cancel"), WORLDEDIT_CANCEL_COUNT("&cCancelled %s0 edits.", "Cancel"),
WORLDEDIT_CANCEL_REASON("&cYour WorldEdit action was cancelled:&7 %s0&c.", "Cancel"), WORLDEDIT_CANCEL_REASON("&cYour WorldEdit action was cancelled:&7 %s0&c.", "Cancel"),
WORLDEDIT_CANCEL_REASON_MANUAL("Manual cancellation", "Cancel"), WORLDEDIT_CANCEL_REASON_MANUAL("Manual cancellation", "Cancel"),

View File

@ -1120,6 +1120,11 @@ public class EditSession implements Extent {
*/ */
public void flushQueue() { public void flushQueue() {
Operations.completeBlindly(commit()); Operations.completeBlindly(commit());
// Check fails
int fails = getLimitUsed().MAX_FAILS;
if (fails > 0) {
BBC.WORLDEDIT_SOME_FAILS.send(player, fails);
}
// Enqueue it // Enqueue it
if (queue == null || queue.size() == 0) { if (queue == null || queue.size() == 0) {
queue.dequeue(); queue.dequeue();