From 8b89e2ef96c8ab25cdf6348ba9b2a64540497eec Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 6 May 2020 18:38:36 +0200 Subject: [PATCH] fix: Use LoginEvent instaed of PreLogin --- .../varo/listeners/PlayerPreLoginListener.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerPreLoginListener.java b/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerPreLoginListener.java index c09d991..fed391b 100644 --- a/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerPreLoginListener.java +++ b/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerPreLoginListener.java @@ -2,8 +2,8 @@ package de.cliffbreak.varo.listeners; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.AsyncPlayerPreLoginEvent; -import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result; +import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.event.player.PlayerLoginEvent.Result; import de.cliffbreak.varo.Varo; @@ -16,8 +16,9 @@ public class PlayerPreLoginListener implements Listener { } @EventHandler - public void onPlayerPreLogin(final AsyncPlayerPreLoginEvent e) { - if (plugin.banUtils.isBanned(e.getPlayerProfile().getId())) + public void onPlayerPreLogin(final PlayerLoginEvent e) { + if (plugin.banUtils.isBanned(e.getPlayer().getUniqueId())) { e.disallow(Result.KICK_BANNED, "§4Du bist gestorben.\n \n§cDamit bist du aus §eVaro§c ausgeschieden."); + } } } \ No newline at end of file