Explicitly disable ProtocolLib listener on stop

This will stop Paper complaining about still running asynchronous tasks
which is a useful feature.
This commit is contained in:
games647
2022-06-19 12:10:31 +02:00
parent 6f9e8a49f1
commit 5e159cac64

View File

@ -25,6 +25,7 @@
*/
package com.github.games647.fastlogin.bukkit;
import com.comphenix.protocol.ProtocolLibrary;
import com.github.games647.fastlogin.bukkit.command.CrackedCommand;
import com.github.games647.fastlogin.bukkit.command.PremiumCommand;
import com.github.games647.fastlogin.bukkit.listener.ConnectionListener;
@ -202,6 +203,10 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
logger.error("Failed to unregister placeholder", exception);
}
}
if (isPluginInstalled("ProtocolLib")) {
ProtocolLibrary.getProtocolManager().getAsynchronousManager().unregisterAsyncHandlers(this);
}
}
public FastLoginCore<Player, CommandSender, FastLoginBukkit> getCore() {