Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
9f7f5eef36
Commit
c74b2b2c84
@ -26,15 +26,13 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|||||||
import net.md_5.bungee.api.event.SettingsChangedEvent;
|
import net.md_5.bungee.api.event.SettingsChangedEvent;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class SettingsChangedListener extends BasicListener {
|
public class SettingsChangedListener extends BasicListener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onSettingsChanged(SettingsChangedEvent event) {
|
public void onSettingsChanged(SettingsChangedEvent event) {
|
||||||
BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
||||||
ProxiedPlayer player = event.getPlayer();
|
ProxiedPlayer player = event.getPlayer();
|
||||||
SteamwarUser.get(player).setLocale(Objects.requireNonNull(player.getLocale()), false);
|
SteamwarUser.get(player).setLocale(player.getLocale(), false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ public class SteamwarUser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setLocale(Locale locale, boolean manualLocale) {
|
public void setLocale(Locale locale, boolean manualLocale) {
|
||||||
if (this.manualLocale && !manualLocale)
|
if (locale == null || (this.manualLocale && !manualLocale))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren