fix: Use LoginEvent instaed of PreLogin

This commit is contained in:
Simon Giesel 2020-05-06 18:38:36 +02:00
parent d2b4772242
commit 8b89e2ef96

View file

@ -2,8 +2,8 @@ package de.cliffbreak.varo.listeners;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result; import org.bukkit.event.player.PlayerLoginEvent.Result;
import de.cliffbreak.varo.Varo; import de.cliffbreak.varo.Varo;
@ -16,8 +16,9 @@ public class PlayerPreLoginListener implements Listener {
} }
@EventHandler @EventHandler
public void onPlayerPreLogin(final AsyncPlayerPreLoginEvent e) { public void onPlayerPreLogin(final PlayerLoginEvent e) {
if (plugin.banUtils.isBanned(e.getPlayerProfile().getId())) if (plugin.banUtils.isBanned(e.getPlayer().getUniqueId())) {
e.disallow(Result.KICK_BANNED, "§4Du bist gestorben.\n \n§cDamit bist du aus §eVaro§c ausgeschieden."); e.disallow(Result.KICK_BANNED, "§4Du bist gestorben.\n \n§cDamit bist du aus §eVaro§c ausgeschieden.");
} }
}
} }