diff --git a/src/de/steamwar/bungeecore/listeners/SettingsChangedListener.java b/src/de/steamwar/bungeecore/listeners/SettingsChangedListener.java index 5c427f9..3858a69 100644 --- a/src/de/steamwar/bungeecore/listeners/SettingsChangedListener.java +++ b/src/de/steamwar/bungeecore/listeners/SettingsChangedListener.java @@ -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); + }); } }