ProtocolLib

3M Downloads

The plugin can't hook into ProtocolLib.

MajliTech opened this issue ยท 3 comments

commented
  • This issue is not solved in a development build

Describe the bug
The plugin can't hook into ProtocolLib..

private ProtocolManager protocolManager;

@Override
public void onEnable() {
        protocolManager = ProtocolLibrary.getProtocolManager();
        this.getCommand("hook").setExecutor(new CommandHook());
    }

To Reproduce
Steps to reproduce the behavior:

  1. Clone the plugin https://github.com/MajliTech/NoDeathSound
  2. Build it
  3. Upload it along with protocollib
  4. run /hook

Expected behavior
The plugin should hook into ProtocolManager

Screenshots
If applicable, add screenshots to help explain your problem.

Version Info

/protocol dump
ProtocolLib Dump
Timestamp: 04/04/23 20:52:50

ProtocolLib Version: ProtocolLib v5.0.0-SNAPSHOT-b630
Bukkit Version: 1.18.2-R0.1-SNAPSHOT
Server Version: 3498-Spigot-b081915-10ba1be (MC: 1.18.2)
Java Version: 17.0.6

ProtocolLib: com.comphenix.protocol.ProtocolLib@686833ee[
  statistics=com.comphenix.protocol.metrics.Statistics@36b64e43
  packetTask=2
  tickCounter=5691
  configExpectedMod=1
  updater=com.comphenix.protocol.updater.SpigotUpdater@1c1de47c
  redirectHandler=com.comphenix.protocol.ProtocolLib$2@34992e89
  commandProtocol=com.comphenix.protocol.CommandProtocol@1dc78cb7
  commandPacket=com.comphenix.protocol.CommandPacket@19871d1a
  commandFilter=com.comphenix.protocol.CommandFilter@6a4a3452
  packetLogging=com.comphenix.protocol.PacketLogging@17dab2f4
  skipDisable=false
  isEnabled=true
  loader=org.bukkit.plugin.java.JavaPluginLoader@3659268c
  server=CraftServer{serverName=CraftBukkit,serverVersion=3498-Spigot-b081915-10ba1be,minecraftVersion=1.18.2}
  file=plugins/ProtocolLib (2).jar
  description=org.bukkit.plugin.PluginDescriptionFile@2c44dc94
  dataFolder=plugins/ProtocolLib
  classLoader=org.bukkit.plugin.java.PluginClassLoader@14c94db6
  naggable=true
  newConfig=YamlConfiguration[path='', root='YamlConfiguration']
  configFile=plugins/ProtocolLib/config.yml
  logger=org.bukkit.plugin.PluginLogger@1159b0e9
]
Manager: com.comphenix.protocol.injector.PacketFilterManager@3af12350[
  plugin=ProtocolLib v5.0.0-SNAPSHOT-b630
  server=CraftServer{serverName=CraftBukkit,serverVersion=3498-Spigot-b081915-10ba1be,minecraftVersion=1.18.2}
  reporter=com.comphenix.protocol.ProtocolLib$1@30dbe8e6
  minecraftVersion=(MC: 1.18.2)
  asyncFilterManager=com.comphenix.protocol.async.AsyncFilterManager@295d441
  pluginVerifier=com.comphenix.protocol.injector.PluginVerifier@5e17f202
  inboundListeners=com.comphenix.protocol.injector.SortedPacketListenerList@6dcfb133
  outboundListeners=com.comphenix.protocol.injector.SortedPacketListenerList@2bcf8b4
  registeredListeners=[]
  packetInjector=com.comphenix.protocol.injector.netty.manager.NetworkManagerPacketInjector@2e27037e
  playerInjectionHandler=com.comphenix.protocol.injector.netty.manager.NetworkManagerPlayerInjector@4f41635a
  networkManagerInjector=com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector@5f1715a8
  debug=false
  closed=false
  injected=true
]

No listeners
Server log
[20:56:17] [Server thread/INFO]: MajliPlayz issued server command: /hook
[20:56:17] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'hook' in plugin NoDeathSoundv2 v1.0-SNAPSHOT
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:826) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1957) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1796) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1777) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1190) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.util.thread.IAsyncTaskHandler.y(SourceFile:131) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.be(MinecraftServer.java:1169) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1162) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1146) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1051) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.protocolManager" is null
        at techus.nodeathsoundv2.CommandHook.onCommand(CommandHook.java:26) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        ... 21 more

Additional context
This prevents the plugin work.

commented

Screen Shot 2023-04-04 at 2 24 07 PM

commented

I also tried normal version 4.8.0, didn't work

commented

Yeah, probably my fault, marking as wontfix.