You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (finalMap.Entry<String, String> entry : variants.entrySet()) {
38
+
Class.forName(entry.getKey());
39
+
returnentry.getValue();
40
+
}
41
+
} catch (ClassNotFoundExceptionignored) { }
42
+
43
+
// TODO attempt to get the variant from one extra place before returning Unknown
44
+
// Example 1: https://github.com/PaperMC/Paper/blob/f7717c3712265fd480d6ff0ad808c430b9972004/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch#L17
45
+
// Example 2: https://github.com/PurpurMC/Purpur/blob/678eafef721b1a3d819fbaff7dd980bc9f4ee785/patches/server/0003-Rebrand.patch#L208
PlaceholderAPIPlugin.getInstance().getLogger().log(Level.SEVERE, "[server] Could not invoke method MinecraftServer#getServer", e);
64
+
}
65
+
66
+
returnnull;
67
+
}
68
+
69
+
privatestaticFieldgetTpsHandler() {
70
+
try {
71
+
Bukkit.class.getMethod("getTPS");
72
+
hasTpsMethod = true;
73
+
} catch (NoSuchMethodExceptionignored) { }
74
+
75
+
if (craftServer == null) {
76
+
PlaceholderAPIPlugin.getInstance().getLogger().log(Level.WARNING, "Could not get field 'recentTps' from class MinecraftServer because variable 'craftServer' is null");
0 commit comments