mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
Fix #3095
This commit is contained in:
parent
440afcca5d
commit
a3ebabacb8
@ -339,6 +339,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
PlotSquared.platform().playerManager().removePlayer(player.getUniqueId());
|
PlotSquared.platform().playerManager().removePlayer(player.getUniqueId());
|
||||||
final PlotPlayer<Player> pp = BukkitUtil.adapt(player);
|
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();
|
Location location = pp.getLocation();
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
if (area != null) {
|
if (area != null) {
|
||||||
@ -1677,6 +1680,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLocaleChange(final PlayerLocaleChangeEvent event) {
|
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());
|
BukkitPlayer player = BukkitUtil.adapt(event.getPlayer());
|
||||||
// we're stripping the country code as we don't want to differ between countries
|
// we're stripping the country code as we don't want to differ between countries
|
||||||
player.setLocale(Locale.forLanguageTag(event.getLocale().substring(0, 2)));
|
player.setLocale(Locale.forLanguageTag(event.getLocale().substring(0, 2)));
|
||||||
|
Loading…
Reference in New Issue
Block a user