zeshan321 / ActionHealth

ActionHealth is a highly configurable Minecraft plugin that utilizes the action bar to display entity health.
MIT License
41 stars 39 forks source link

Update to support 1.21 #67

Open Electronik21 opened 5 months ago

Electronik21 commented 5 months ago

The plugin doesn't work on Paper 1.21, tested on build 9. When you look at a mob it doesn't show the healthbar, and it spams this error in the console:

[ActionHealth] Task #2 for ActionHealth v3.5.9 generated an exception
java.lang.NullPointerException: Cannot read the array length because "<local2>" is null
        at io.papermc.paper.pluginremap.reflect.PaperReflection.parameterDescriptor(PaperReflection.java:147) ~[paper-1.21.jar:1.21-9-4ea696f]
        at io.papermc.paper.pluginremap.reflect.PaperReflection.strippedMethodKey(PaperReflection.java:141) ~[paper-1.21.jar:1.21-9-4ea696f]
        at io.papermc.paper.pluginremap.reflect.PaperReflection.findMappedMethodName(PaperReflection.java:94) ~[paper-1.21.jar:1.21-9-4ea696f]
        at io.papermc.paper.pluginremap.reflect.PaperReflection.mapMethodName(PaperReflection.java:71) ~[paper-1.21.jar:1.21-9-4ea696f]
        at io.papermc.reflectionrewriter.runtime.AbstractDefaultRulesReflectionProxy.getMethod(AbstractDefaultRulesReflectionProxy.java:100) ~[reflection-rewriter-runtime-0.0.1.jar:?]
        at io.papermc.paper.pluginremap.reflect.PaperReflectionHolder.getMethod(Unknown Source) ~[paper-1.21.jar:1.21-9-4ea696f]
        at ActionHealth-3.5.9-all.jar/com.zeshanaslam.actionhealth.utils.HealthUtil.getNameReflection(HealthUtil.java:245) ~[ActionHealth-3.5.9-all.jar:?]
        at ActionHealth-3.5.9-all.jar/com.zeshanaslam.actionhealth.utils.HealthUtil.getName(HealthUtil.java:222) ~[ActionHealth-3.5.9-all.jar:?]
        at ActionHealth-3.5.9-all.jar/com.zeshanaslam.actionhealth.LookThread.run(LookThread.java:36) ~[ActionHealth-3.5.9-all.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.21.jar:1.21-9-4ea696f]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:482) ~[paper-1.21.jar:1.21-9-4ea696f]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1654) ~[paper-1.21.jar:1.21-9-4ea696f]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:471) ~[paper-1.21.jar:1.21-9-4ea696f]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1538) ~[paper-1.21.jar:1.21-9-4ea696f]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1246) ~[paper-1.21.jar:1.21-9-4ea696f]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.jar:1.21-9-4ea696f]
        at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]

It looks like something to do with Paper using mojang mappings now and remapping the plugins, but I don't know much about plugin development or the server in general

Aurelien30000 commented 4 months ago

Hi, thanks for the report, looks like a Paper issue, I reported it to the team! Additionally, I will be making a pull request for full 1.21 support soon.

Pro245Mc commented 1 month ago

Hi there, any news on this update?