diff --git a/Plan/bukkit/src/main/java/com/djrapitops/plan/addons/placeholderapi/PlanPlaceholderExtension.java b/Plan/bukkit/src/main/java/com/djrapitops/plan/addons/placeholderapi/PlanPlaceholderExtension.java index b50feda7c..512aa384a 100644 --- a/Plan/bukkit/src/main/java/com/djrapitops/plan/addons/placeholderapi/PlanPlaceholderExtension.java +++ b/Plan/bukkit/src/main/java/com/djrapitops/plan/addons/placeholderapi/PlanPlaceholderExtension.java @@ -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); }