-
I'm currently struggling to properly hook into ProtocolLib to use for manipulating the Server list's MOTD and alike. Whenever my plugin starts am I encountering this particular error:
I first thought this might be because I load events on the ServerLoadEvent and also call Here's the old code I used for reference: @EventHandler
public void onServerLoad(ServerLoadEvent event){
if(!plugin.getServer().getPluginManager().isPluginEnabled("ProtocolLib")){
plugin.getCore().getPluginLogger().warn("ProtocolLib not found! AdvancedServerList requires it to work on Spigot!");
plugin.getServer().getPluginManager().disablePlugin(plugin);
return;
}
PluginManager manager = plugin.getServer().getPluginManager();
manager.registerEvents(new JoinEvent(plugin), plugin);
manager.registerEvents(new PingEvent(plugin, ProtocolLibrary.getProtocolManager()), plugin);
} But even when I create the ProtocolManager instance during the The reason why I'm doing this weird setup with the ServerLoadEvent and not just do stuff during the Here is the full class for the Packet handling: I appreciate any help that can be given here. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
One guess I have is that I'm using 4.8.0 of ProtocolLib for the API while v5 is used on the server (At least I recall it being the v5 dev build since it is a 1.19 server). If there really is a difference, is there an easy way to support both versions in some way? Not really want to make yet another module just to include two ProtocolLib versions. |
Beta Was this translation helpful? Give feedback.
-
Try to set the scope of the ProtocolLib dependency to |
Beta Was this translation helpful? Give feedback.
Try to set the scope of the ProtocolLib dependency to
provided
.