SteamWar/BungeeCore
Archiviert
13
2

Fix SettingsChangedListener error message
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-05-28 12:57:51 +02:00
Ursprung 61b264ffcd
Commit caa36b9461

Datei anzeigen

@ -19,7 +19,9 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.connection.ProxiedPlayer; 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;
@ -30,7 +32,9 @@ public class SettingsChangedListener extends BasicListener {
@EventHandler @EventHandler
public void onSettingsChanged(SettingsChangedEvent event) { public void onSettingsChanged(SettingsChangedEvent event) {
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(Objects.requireNonNull(player.getLocale()), false);
});
} }
} }