fix: Use LoginEvent instaed of PreLogin
This commit is contained in:
parent
d2b4772242
commit
8b89e2ef96
1 changed files with 5 additions and 4 deletions
|
@ -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.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue