Added primary thread error when running a rollback via API (implements #456)

This commit is contained in:
Intelli 2024-07-09 18:59:16 -06:00
parent 4bf4f4eb92
commit da227afe33
3 changed files with 5 additions and 0 deletions

View File

@ -546,6 +546,9 @@ public class CoreProtectAPI extends Queue {
boolean verbose = false;
result = Rollback.performRollbackRestore(statement, null, uuids, restrictUsers, null, restrictBlocks, excludeBlocks, excludeUsers, actionList, location, argRadius, startTime, endTime, restrictWorld, false, verbose, action, 0);
}
else {
Chat.console(Phrase.build(Phrase.PRIMARY_THREAD_ERROR));
}
}
statement.close();

View File

@ -176,6 +176,7 @@ public class Language {
phrases.put(Phrase.PREVIEW_CANCELLING, "Cancelling preview...");
phrases.put(Phrase.PREVIEW_IN_GAME, "You can only preview rollbacks in-game.");
phrases.put(Phrase.PREVIEW_TRANSACTION, "You can't preview {container|inventory} transactions.");
phrases.put(Phrase.PRIMARY_THREAD_ERROR, "That API method can't be used on the primary thread.");
phrases.put(Phrase.PURGE_ABORTED, "Purge failed. Database may be corrupt.");
phrases.put(Phrase.PURGE_ERROR, "Unable to process {0} data!");
phrases.put(Phrase.PURGE_FAILED, "Purge failed. Please try again later.");

View File

@ -159,6 +159,7 @@ public enum Phrase {
PREVIEW_CANCELLING,
PREVIEW_IN_GAME,
PREVIEW_TRANSACTION,
PRIMARY_THREAD_ERROR,
PURGE_ABORTED,
PURGE_ERROR,
PURGE_FAILED,