Archiviert
1
0

Fix SettingsChangedListener error message

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;
import de.steamwar.bungeecore.BungeeCore;
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.event.SettingsChangedEvent;
import net.md_5.bungee.event.EventHandler;
@ -30,7 +32,9 @@ public class SettingsChangedListener extends BasicListener {
@EventHandler
public void onSettingsChanged(SettingsChangedEvent event) {
ProxiedPlayer player = event.getPlayer();
SteamwarUser.get(player).setLocale(Objects.requireNonNull(player.getLocale()), false);
BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
ProxiedPlayer player = event.getPlayer();
SteamwarUser.get(player).setLocale(Objects.requireNonNull(player.getLocale()), false);
});
}
}