Fix player locale retrieval on Bukkit 1.8 (#2930)

This commit is contained in:
Luck 2021-03-19 19:33:08 +00:00
parent 0f63b024e4
commit ad1ba3c126
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -47,7 +47,7 @@ public final class PlayerLocaleUtil {
Method legacyMethod = Player.Spigot.class.getMethod("getLocale");
function = player -> {
try {
return (String) legacyMethod.invoke(player);
return (String) legacyMethod.invoke(player.spigot());
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
}