JustDoom / Better-Messages

A Spigot plugin to add configurable messages!
https://imjustdoom.com/projects/better-messages
13 stars 4 forks source link

Plugin fails to enable on Paper/Purpur 1.20.4 #5

Closed Mikkel136 closed 10 months ago

Mikkel136 commented 10 months ago

Heyo! 👋! I'm having problems running your plugin on the recent Paper and Purpur releases for 1.20.4.

Latest Modrinth release and a fresh Github build is affected.

I don't quite understand the cause of this problem. As I don't speak Java myself, I don't quite have the brain power to fix this on my own and submit a pull request.

Stacktrace:

[17:01:10 ERROR]: Error occurred while enabling BetterMessages v3.3.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "String.equalsIgnoreCase(String)" because "messageType" is null
        at com.imjustdoom.bettermessages.message.Message.<init>(Message.java:53) ~[BetterMessages-3.3.0.jar:?]
        at com.imjustdoom.bettermessages.message.msg.WorldChangeMessage.<init>(WorldChangeMessage.java:19) ~[BetterMessages-3.3.0.jar:?]
        at com.imjustdoom.bettermessages.message.MessageBuilder.build(MessageBuilder.java:33) ~[BetterMessages-3.3.0.jar:?]
        at com.imjustdoom.bettermessages.config.Config.init(Config.java:108) ~[BetterMessages-3.3.0.jar:?]
        at com.imjustdoom.bettermessages.BetterMessages.onEnable(BetterMessages.java:33) ~[BetterMessages-3.3.0.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:190) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugin(CraftServer.java:651) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugins(CraftServer.java:562) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:678) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:438) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:345) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1148) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[purpur-1.20.4.jar:git-Purpur-2119]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
JustDoom commented 10 months ago

Are you updating from an older version to the new version?

Mikkel136 commented 10 months ago

Correct, I've updated from BetterMessages from 3.1 to 3.2.1 and then 3.3.0. I just tried re-generating and re-doing the config, and that seems to have worked!

The major differences between the two configs are "config-version" being updated from 15 to 16, and the inclusion of "message-type" parameters in the new config.

Perhaps this lack of "message-type" isn't handled properly?

Attaching the old config below for reference: https://pastebin.com/FzjepHqh

JustDoom commented 10 months ago

Yeah, looking at the error message it was missing that config option. In the current version it isn't handled too well but that will be fixed in the next major version (4.0). This seems to be solved now