Animated-TabList

Animated-TabList

65.2k Downloads

Java 14 compatibility

SlimeDog opened this issue ยท 9 comments

commented

Problem

Reflection does not play well in Java 14

Details

CentOS Linux 7.8.2003 (up-to-date)
Java 14.0.2
Spigot 1.16.2 (and likely others)
TabList 5.4.6

Console error

On player connect, repeated every TabList refresh:

[07:43:38] [Server thread/WARN]: java.lang.NoSuchFieldException: modifiers
[07:43:38] [Server thread/WARN]:        at java.base/java.lang.Class.getDeclaredField(Class.java:2489)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.utils.ReflectionUtils.getField(ReflectionUtils.java:72)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.utils.ReflectionUtils.getField(ReflectionUtils.java:68)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.utils.ReflectionUtils.modifyFinalField(ReflectionUtils.java:85)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.tablist.groups.ReflectionHandled.updateName(ReflectionHandled.java:130)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.tablist.groups.ReflectionHandled.unregisterTeam(ReflectionHandled.java:107)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.Groups.removePlayerGroup(Groups.java:206)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.TabList.onPlayerQuit(TabList.java:366)
[07:43:38] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.listeners.Listeners.onPlayerLeave(Listeners.java:66)
[07:43:38] [Server thread/WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[07:43:38] [Server thread/WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[07:43:38] [Server thread/WARN]:        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[07:43:38] [Server thread/WARN]:        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[07:43:38] [Server thread/WARN]:        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315)
[07:43:38] [Server thread/WARN]:        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[07:43:38] [Server thread/WARN]:        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
[07:43:38] [Server thread/WARN]:        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerList.disconnect(PlayerList.java:417)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1411)
[07:43:38] [Server thread/WARN]:        at com.denizenscript.denizen.nms.v1_16.impl.network.handlers.AbstractListenerPlayInImpl.a(AbstractListenerPlayInImpl.java:361)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.NetworkManager.handleDisconnection(NetworkManager.java:323)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.ServerConnection.c(ServerConnection.java:150)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1126)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:352)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1007)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:846)
[07:43:38] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164)
[07:43:38] [Server thread/WARN]:        at java.base/java.lang.Thread.run(Thread.java:832)

No errors on Java 8 or Java 11.

commented

455a3a1
Maybe this fixes the issue, but not sure because JVM removed final field modifying in 12+ versions. You can test this by downloading from here in Artifacts section after the build process is done.

commented

The test version at here above does not fix the issue. BTW, it self-reports as version 5.4.6, rather than 5.4.7.

commented

Please include the console error with the new build.

commented
[05:03:02] [Server thread/WARN]: java.lang.reflect.InvocationTargetException
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.reflect.GeneratedMethodAccessor258.invoke(Unknown Source)
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[05:03:02] [Server thread/WARN]:        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[05:03:02] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.utils.ReflectionUtils.modifyFinalField(ReflectionUtils.java:102)
[05:03:02] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.tablist.groups.ReflectionHandled.updateName(ReflectionHandled.java:126)
[05:03:02] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.tablist.groups.ReflectionHandled.unregisterTeam(ReflectionHandled.java:104)
[05:03:02] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.Groups.removePlayerGroup(Groups.java:206)
[05:03:02] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.TabList.onPlayerQuit(TabList.java:371)
[05:03:02] [Server thread/WARN]:        at hu.montlikadani.tablist.bukkit.listeners.Listeners.onPlayerLeave(Listeners.java:66)
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[05:03:02] [Server thread/WARN]:        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[05:03:02] [Server thread/WARN]:        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315)
[05:03:02] [Server thread/WARN]:        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[05:03:02] [Server thread/WARN]:        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
[05:03:02] [Server thread/WARN]:        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerList.disconnect(PlayerList.java:417)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1411)
[05:03:02] [Server thread/WARN]:        at com.denizenscript.denizen.nms.v1_16.impl.network.handlers.AbstractListenerPlayInImpl.a(AbstractListenerPlayInImpl.java:361)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.NetworkManager.handleDisconnection(NetworkManager.java:323)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.ServerConnection.c(ServerConnection.java:150)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1126)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:349)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1007)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:846)
[05:03:02] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164)
[05:03:02] [Server thread/WARN]:        at java.base/java.lang.Thread.run(Thread.java:832)
[05:03:02] [Server thread/WARN]: Caused by: java.lang.IllegalArgumentException
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.misc.Unsafe.staticFieldBase0(Native Method)
[05:03:02] [Server thread/WARN]:        at java.base/jdk.internal.misc.Unsafe.staticFieldBase(Unsafe.java:1113)
[05:03:02] [Server thread/WARN]:        at jdk.unsupported/sun.misc.Unsafe.staticFieldBase(Unsafe.java:676)
[05:03:02] [Server thread/WARN]:        ... 28 more
commented

This build produced:
1 completed job
in 4m 1s
Ran 1 hour ago
Artifacts

No artifacts
No artifacts were generated.

Annotations

Check failure on line 1 in .github

@github-actions
github-actions
/ build

.github#L1
Process completed with exit code 1.

commented

Sorry, compilation issue, new build here

commented

Later builds works without error on Java 11 and Java 14, Spigot 1.16.3. Thanks.

commented

BTW, it still self-identifies as 5.4.6 even though the file is tablist-5.4.7.jar

commented

This build should works, confirmed.