rayzr522 / JSONMessage

A modern version of Fanciful
MIT License
30 stars 14 forks source link

JSONMessage is incompatible with Spigot 1.17 #14

Closed uhFinn closed 3 years ago

uhFinn commented 3 years ago

Hey, so I'm getting somewhat of an error: java.lang.IllegalStateException: JSONMessage.ReflectionHelper is not set up yet! at me.rayzr522.jsonmessage.JSONMessage$ReflectionHelper.assertIsSetup(JSONMessage.java:845) ~[?:?] at me.rayzr522.jsonmessage.JSONMessage$ReflectionHelper.createTextPacket(JSONMessage.java:737) ~[?:?] at me.rayzr522.jsonmessage.JSONMessage.send(JSONMessage.java:171) ~[?:?] at uhfinn.test.Listeners.PlayerJoin$1.run(PlayerJoin.java:79) ~[?:?] at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:400) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1252) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:436) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1200) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1027) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot-1.17.jar:3145-Spigot-9472b09-f992ce6] at java.lang.Thread.run(Thread.java:831) [?:?]

Just wondering as to what caused it and how I would go about fixing this, The issue only occurs on the first time a plugin is ran on a server and can only be fixed by restarting the server

rayzr522 commented 3 years ago

@uhFinn JSONMessage is not compatible with Spigot 1.17 yet, as there were massive changes to the internals of the Minecraft server code in the latest update. I have been working on the side to update it to support 1.17 but there's a lot of work involved. i will hopefully have a new version out soon!

uhFinn commented 3 years ago

@uhFinn JSONMessage is not compatible with Spigot 1.17 yet, as there were massive changes to the internals of the Minecraft server code in the latest update. I have been working on the side to update it to support 1.17 but there's a lot of work involved. i will hopefully have a new version out soon!

Ahh thank you, I didnt even think about that being a potential cause for the issue, thanks again

rayzr522 commented 3 years ago

yea the thing that makes this error message a bit obscure is that it doesn't actually give you any information about why ReflectionHelper failed to set up. you would have to scroll up in the logs to find the error messages related to that, as it's all handled in a static init block in the ReflectionHelper subclass. presumably something about a ClassNotFoundException :)

ManuelHummel commented 3 years ago

Hey @rayzr522 , So I´ve taken some time to look into your code and try to fix it for version 1.7!

Since I´m not fully into this type of Plugin/Spigot coding it might have some issues, but the basic features should work in the new version. Anyways I hope this helps you fixing this awesome tool (!) and provides a temporary solution for others such as @uhFinn .

Best, MH JSONMessage.txt

rayzr522 commented 3 years ago

@ManuelHummel thanks for providing this! I've just opened PR #15 with proper support for 1.17 as well as a better system so updating for new versions isn't so difficult going forward. if you would like to review the changes you're more than welcome to, as i'm currently awaiting the review of a member of my Discord server.

i should hopefully get that review tomorrow & then i'll merge this PR and release a new version. keep an eye out for it! :)