aadnk / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
288 stars 92 forks source link

Java 15 Incompatibility #180

Open AoElite opened 3 years ago

AoElite commented 3 years ago

Describe the bug Run the ProtocolLib on a Java 15 server and then join. Let the errors begin!

To Reproduce

  1. Run Java 15 on a server
  2. Join the server
  3. Errors!

Expected behavior No errors!

Screenshots

net.minecraft.server.v1_16_R3.ReportedException: Sending packet
    at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1434) ~[patched_1.16.4.jar:git-Tuinity-"d1db107"]
    at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:378) ~[patched_1.16.4.jar:git-Tuinity-"d1db107"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1269) ~[patched_1.16.4.jar:git-Tuinity-"d1db107"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1001) ~[patched_1.16.4.jar:git-Tuinity-"d1db107"]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:179) ~[patched_1.16.4.jar:git-Tuinity-"d1db107"]
    at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.IllegalStateException: Cannot use reflection.
    at com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor.set(DefaultFieldAccessor.java:30) ~[?:?]
    at com.comphenix.protocol.injector.netty.ChannelInjector$3.handleScheduled(ChannelInjector.java:353) ~[?:?]
    at com.comphenix.protocol.injector.netty.ChannelInjector$3.onMessageScheduled(ChannelInjector.java:317) ~[?:?]
    at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable(ChannelProxy.java:127) ~[?:?]
    at com.comphenix.protocol.injector.netty.EventLoopProxy.execute(EventLoopProxy.java:95) ~[?:?]

Version Info Using the latest 1.16 ProtocolLib from Jenkins

Additional context Not using protocol lib will not throw any errors on Java 15. Using another version of Java like 11 or 8 won't throw errors either.

glitchring commented 2 years ago

What to do with it?

cderszteler commented 2 years ago

Half a year ago we had the same error, but we could fix it. I don't really know how to fix this in detail, but our problem was the outdated ProtocolLib version. So, to put it in a nutshell: Use the heighest ProtocoLlib version for your server version and the corresponding Java version to the ProtocolLib version. Normaly, using the newest ProtocolLib and Java version works absolutely fine.