geforkt von SteamWar/BungeeCore
Fix settings changed npe
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.event.EventHandler;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class SettingsChangedListener extends BasicListener {
|
||||
|
||||
@EventHandler
|
||||
public void onSettingsChanged(SettingsChangedEvent event) {
|
||||
BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
||||
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) {
|
||||
if (this.manualLocale && !manualLocale)
|
||||
if (locale == null || (this.manualLocale && !manualLocale))
|
||||
return;
|
||||
|
||||
this.locale = locale;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren