mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
Fix bungeecord support (Fixes #26)
This commit is contained in:
@ -134,14 +134,14 @@ public class FastLoginBukkit extends JavaPlugin {
|
||||
//clean up
|
||||
session.clear();
|
||||
|
||||
if (core != null) {
|
||||
core.close();
|
||||
}
|
||||
|
||||
//remove old blacklists
|
||||
for (Player player : getServer().getOnlinePlayers()) {
|
||||
player.removeMetadata(getName(), this);
|
||||
}
|
||||
|
||||
if (core != null) {
|
||||
core.close();
|
||||
}
|
||||
}
|
||||
|
||||
public FastLoginCore getCore() {
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
/**
|
||||
* This listener tells authentication plugins if the player has a premium account and we checked it successfully. So the
|
||||
@ -42,4 +43,10 @@ public class BukkitJoinListener implements Listener {
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new ForceLoginTask(plugin, player), DELAY_LOGIN);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerQuit(PlayerQuitEvent quitEvent) {
|
||||
Player player = quitEvent.getPlayer();
|
||||
player.removeMetadata(plugin.getName(), plugin);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class ForceLoginTask implements Runnable {
|
||||
BungeeLoginSession session = plugin.getSession().get(pendingConnection);
|
||||
PlayerProfile playerProfile = session.getProfile();
|
||||
|
||||
if (player.isConnected()) {
|
||||
if (!player.isConnected()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user