Skip to content

Commit

Permalink
Match Folia Region scheduler threads as Server tick threads
Browse files Browse the repository at this point in the history
Affects issues:
- Fixed #3839
  • Loading branch information
AuroraLS3 committed Nov 30, 2024
1 parent 55f7557 commit a6887c8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,17 @@ public String getVersion() {
return versionChecker.getCurrentVersion();
}

private static boolean isServerThread() {
String threadName = Thread.currentThread().getName();
return "Server thread".equalsIgnoreCase(threadName) // Spigot
|| threadName != null && threadName.contains("Region Scheduler Thread"); // Folia
}

@Override
public String onRequest(OfflinePlayer player, @Untrusted String params) {
try {
UUID uuid = player != null ? player.getUniqueId() : null;
if ("Server thread".equalsIgnoreCase(Thread.currentThread().getName())) {
if (isServerThread()) {
return getCached(params, uuid);
}

Expand Down

0 comments on commit a6887c8

Please sign in to comment.