Closed GrowlyX closed 2 years ago
LGTM, thanks!
Keep in mind commit https://github.com/Revxrsal/Lamp/pull/15/commits/d8668a9f85ac78b8ae9487b7876b01166da19c64 makes it incompatible with Bukkit, but (as far as I know) there is a locale
field within the EntityPlayer class if you wish to support bukkit (which I assume you do, considering the module name is bukkit
).
Not sure if this field exists in every version, but most versions I was able to find contain it:
Rather simple reflection should be able to retrieve this field.
Keep in mind commit d8668a9 makes it incompatible with Bukkit, but (as far as I know) there is a
locale
field within the EntityPlayer class if you wish to support bukkit (which I assume you do, considering the module name isbukkit
).
Although my pull request was merged, @Revxrsal pushed an additional commit with additional code allowing for fallback locales if an exception is thrown & the use of the modern Player#getLocale
method if available.
Here's the commit: Fix #14
The second commits fixes locales on legacy spigot versions. (https://github.com/Revxrsal/Lamp/issues/14)