mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-02 22:47:37 +01:00
Match Folia Region scheduler threads as Server tick threads
Affects issues: - Fixed #3839
This commit is contained in:
parent
55f7557149
commit
a6887c8c65
@ -89,11 +89,17 @@ public class PlanPlaceholderExtension extends PlaceholderExpansion {
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user