This commit is contained in:
dordsor21 2021-06-18 15:45:45 +01:00
parent 440afcca5d
commit a3ebabacb8
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -339,6 +339,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
PlotSquared.platform().playerManager().removePlayer(player.getUniqueId());
final PlotPlayer<Player> pp = BukkitUtil.adapt(player);
// we're stripping the country code as we don't want to differ between countries
pp.setLocale(Locale.forLanguageTag(player.getLocale().substring(0, 2)));
Location location = pp.getLocation();
PlotArea area = location.getPlotArea();
if (area != null) {
@ -1677,6 +1680,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
@EventHandler
public void onLocaleChange(final PlayerLocaleChangeEvent event) {
// The event is fired before the player is deemed online upon login
if (!event.getPlayer().isOnline()) {
return;
}
BukkitPlayer player = BukkitUtil.adapt(event.getPlayer());
// we're stripping the country code as we don't want to differ between countries
player.setLocale(Locale.forLanguageTag(event.getLocale().substring(0, 2)));