forked from TuxCoding/FastLogin
Fix listening for login start packets if ProtocolLib is installed
Another call on ProtocolLib's types removes all previous listening types Fixes #163
This commit is contained in:
@ -82,8 +82,6 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
||||
if (getServer().getPluginManager().isPluginEnabled("ProtocolSupport")) {
|
||||
getServer().getPluginManager().registerEvents(new ProtocolSupportListener(this), this);
|
||||
} else if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
|
||||
//we are performing HTTP request on these so run it async (seperate from the Netty IO threads)
|
||||
|
||||
//they will be created with a static builder, because otherwise it will throw a
|
||||
//java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener if ProtocolSupport was
|
||||
//only found
|
||||
|
@ -25,15 +25,15 @@ public class ProtocolLibListener extends PacketAdapter {
|
||||
public ProtocolLibListener(FastLoginBukkit plugin) {
|
||||
//run async in order to not block the server, because we are making api calls to Mojang
|
||||
super(params().plugin(plugin)
|
||||
.types(PacketType.Login.Client.START)
|
||||
.types(PacketType.Login.Client.ENCRYPTION_BEGIN)
|
||||
.types(PacketType.Login.Client.START, PacketType.Login.Client.ENCRYPTION_BEGIN)
|
||||
.optionAsync());
|
||||
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public static void register(FastLoginBukkit plugin) {
|
||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager()
|
||||
ProtocolLibrary.getProtocolManager()
|
||||
.getAsynchronousManager()
|
||||
.registerAsyncHandler(new ProtocolLibListener(plugin))
|
||||
.start(WORKER_THREADS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user