mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 02:37:34 +02:00
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")) {
|
if (getServer().getPluginManager().isPluginEnabled("ProtocolSupport")) {
|
||||||
getServer().getPluginManager().registerEvents(new ProtocolSupportListener(this), this);
|
getServer().getPluginManager().registerEvents(new ProtocolSupportListener(this), this);
|
||||||
} else if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
|
} 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
|
//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
|
//java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener if ProtocolSupport was
|
||||||
//only found
|
//only found
|
||||||
|
@ -25,15 +25,15 @@ public class ProtocolLibListener extends PacketAdapter {
|
|||||||
public ProtocolLibListener(FastLoginBukkit plugin) {
|
public ProtocolLibListener(FastLoginBukkit plugin) {
|
||||||
//run async in order to not block the server, because we are making api calls to Mojang
|
//run async in order to not block the server, because we are making api calls to Mojang
|
||||||
super(params().plugin(plugin)
|
super(params().plugin(plugin)
|
||||||
.types(PacketType.Login.Client.START)
|
.types(PacketType.Login.Client.START, PacketType.Login.Client.ENCRYPTION_BEGIN)
|
||||||
.types(PacketType.Login.Client.ENCRYPTION_BEGIN)
|
|
||||||
.optionAsync());
|
.optionAsync());
|
||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register(FastLoginBukkit plugin) {
|
public static void register(FastLoginBukkit plugin) {
|
||||||
ProtocolLibrary.getProtocolManager().getAsynchronousManager()
|
ProtocolLibrary.getProtocolManager()
|
||||||
|
.getAsynchronousManager()
|
||||||
.registerAsyncHandler(new ProtocolLibListener(plugin))
|
.registerAsyncHandler(new ProtocolLibListener(plugin))
|
||||||
.start(WORKER_THREADS);
|
.start(WORKER_THREADS);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user