mrfdev / advanced-achievements

:fireworks: Popular plugin that adds unique and challenging achievements to Minecraft servers.
https://www.spigotmc.org/resources/83466
GNU General Public License v3.0
10 stars 10 forks source link

1.21.0 #11

Closed cobrex1 closed 3 months ago

cobrex1 commented 3 months ago

πŸŽ† Advanced Achievements version

6.0.0

πŸ–₯ Server version

1.21.0 Paper build 44

🚰 Spigot username

Cobrex

𝑾 Wiki read

πŸ“ Existing issues

πŸ› Description

On a fresh server install of AACH the initial install works fine. Config files etc are created. However, when running /aach generate the error below happens and Json files in the data folders are not created. I have a feeling it might be beacuse the location of the book.png is not where it used to be. Not had a chance to investigate it fully.

If this is the issue, I wonder if it would not be better to place the .png in a folder created within aach.

πŸ“„ Server logs

[18:42:17] [Server thread/ERROR]: Command exception: /aach generate
org.bukkit.command.CommandException: Unhandled exception executing command 'aach' in plugin AdvancedAchievements v6.0.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:91) ~[paper-1.21.jar:1.21-44-8d91b85]
    at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
    at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:31) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:103) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:443) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.Commands.performCommand(Commands.java:350) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.Commands.performCommand(Commands.java:337) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.commands.Commands.performCommand(Commands.java:332) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2147) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$11(ServerGamePacketListenerImpl.java:2121) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1541) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1518) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1511) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1470) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1477) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1322) ~[paper-1.21.jar:1.21-44-8d91b85]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.jar:1.21-44-8d91b85]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: com.google.gson.JsonParseException: No key id in MapLike[{"item":"minecraft:book"}]
    at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287) ~[datafixerupper-8.0.16.jar:?]
    at org.bukkit.craftbukkit.util.CraftMagicNumbers.loadAdvancement(CraftMagicNumbers.java:326) ~[paper-1.21.jar:1.21-44-8d91b85]
    at AdvancedAchievements.jar/com.hm.achievement.advancement.AdvancementManager.registerParentAdvancement(AdvancementManager.java:125) ~[AdvancedAchievements.jar:?]
    at AdvancedAchievements.jar/com.hm.achievement.advancement.AdvancementManager.registerAdvancements(AdvancementManager.java:87) ~[AdvancedAchievements.jar:?]
    at AdvancedAchievements.jar/com.hm.achievement.command.executable.GenerateCommand.onExecute(GenerateCommand.java:42) ~[AdvancedAchievements.jar:?]
    at AdvancedAchievements.jar/com.hm.achievement.command.executable.AbstractCommand.execute(AbstractCommand.java:46) ~[AdvancedAchievements.jar:?]
    at AdvancedAchievements.jar/com.hm.achievement.command.executor.PluginCommandExecutor.onCommand(PluginCommandExecutor.java:53) ~[AdvancedAchievements.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
    ... 27 more

βš™ Configuration

No change, it is the default.

cobrex1 commented 3 months ago

OK it is not the location of the book.png as that looks be in the same place for 1.20.4 and 1.21.0

Dalethium commented 3 months ago

https://github.com/mrfdev/advanced-achievements/blob/f994bc9bb898fa0e2af105b3e85153fb7bf1d3f0/advanced-achievements-plugin/src/main/java/com/hm/achievement/advancement/AdvancementJsonHelper.java#L29

This probably needs change from item to id , based on the error.

Greymagic27 commented 3 months ago

Hey. Maintainer of the repo for this plugin. Thanks to Daleth, I've made a PR to solve this.

mrfloris commented 3 months ago

I just wanted to add: Thank you all who contributed, including those who report issues. Our focus is our existing data + new jars for new mc versions.. and hopefully we have no bugs. If others benefits from these changes, that is great..

Thanks for reporting, thanks for helping fix ! I am glad this plugin "should" work on 1.21+

PR has been merged, hopefully compiling things and running it on paper 1.21.0 works now

cobrex1 commented 3 months ago

I don't think this has fully corrected the issue, although when running the command /aach generate, the commands works and the correct files in the world folder are created, however the book tab is not created like before.

It also generate over 1,000 achievements, where as before it was only 60 odd, so not sure what it changed.

There are no errors in console when running the command.

Greymagic27 commented 3 months ago

At least the error is solved.

The issue here is that I don't know enough Java to go in depth to the issues, and my current approach is just to make sure it keeps working on new MC versions. Realistically someone needs to go in and refactor everything for Java 21/MC 1.21

How important is the book tab? What does/did it contain?

cobrex1 commented 3 months ago

Agreed, and I am in the same position, I do not know enough Java yet either and I appreciated your fix.

This part of the plugin runs the Minecraft achievement notifications and screen. accessed by pressing 'L' in-game.