Fix bungeecord support (Fixes #26)

This commit is contained in:
games647 committed 2016-06-13 08:51:47 +02:00
1 parent f04a44b1d2
commit 8abbb8f07c
3 files changed
+12 -5

No files matched your search

@@ -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);
}
}