Skip to content

Commit

Permalink
Added primary thread error when running a rollback via API (implements
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli committed Jul 10, 2024
1 parent 4bf4f4e commit da227af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/net/coreprotect/CoreProtectAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ else if (argBlock instanceof EntityType && !addedEntity) {
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();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/coreprotect/language/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public static void loadPhrases() {
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.");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/coreprotect/language/Phrase.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public enum Phrase {
PREVIEW_CANCELLING,
PREVIEW_IN_GAME,
PREVIEW_TRANSACTION,
PRIMARY_THREAD_ERROR,
PURGE_ABORTED,
PURGE_ERROR,
PURGE_FAILED,
Expand Down

0 comments on commit da227af

Please sign in to comment.