Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not pass event PlayerAdvancementDoneEvent #5

Open
TheKrafter opened this issue Oct 21, 2023 · 5 comments
Open

Could not pass event PlayerAdvancementDoneEvent #5

TheKrafter opened this issue Oct 21, 2023 · 5 comments

Comments

@TheKrafter
Copy link

Every time a player gets an advancement, the an error is sometimes shown in the log, and the advancement message is not sent to the webhook:

[16:47:05 ERROR]: Could not pass event PlayerAdvancementDoneEvent to MinecraftChatToDiscordWebhook v1.1
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
	at me.Shamed.MCCTDW.utils.gson.LocaleProvider.translateLocale(LocaleProvider.java:23) ~[MCCTDW.jar:?]
	at me.Shamed.MCCTDW.webhook.components.formatted.AdvancementMessage.<init>(AdvancementMessage.java:19) ~[MCCTDW.jar:?]
	at me.Shamed.MCCTDW.listeners.AdvancementListener.onPlayerAdvancement(AdvancementListener.java:23) ~[MCCTDW.jar:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor16.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:git-Paper-550]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.19.4.jar:git-Paper-550]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.19.4.jar:git-Paper-550]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
	at net.minecraft.server.PlayerAdvancements.award(PlayerAdvancements.java:246) ~[?:?]
	at net.minecraft.advancements.CriterionTrigger$Listener.run(CriterionTrigger.java:35) ~[?:?]
	at net.minecraft.advancements.critereon.SimpleCriterionTrigger.trigger(SimpleCriterionTrigger.java:73) ~[?:?]
	at net.minecraft.advancements.critereon.InventoryChangeTrigger.lambda$trigger$0(InventoryChangeTrigger.java:57) ~[?:?]
	at net.minecraft.advancements.critereon.InventoryChangeTrigger.trigger(InventoryChangeTrigger.java:53) ~[?:?]
	at net.minecraft.server.level.ServerPlayer$2.slotChanged(ServerPlayer.java:347) ~[?:?]
	at net.minecraft.world.inventory.AbstractContainerMenu.triggerSlotListeners(AbstractContainerMenu.java:306) ~[?:?]
	at net.minecraft.world.inventory.AbstractContainerMenu.broadcastChanges(AbstractContainerMenu.java:243) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handleSetCreativeModeSlot(ServerGamePacketListenerImpl.java:3404) ~[?:?]
	at net.minecraft.network.protocol.game.ServerboundSetCreativeModeSlotPacket.handle(ServerboundSetCreativeModeSlotPacket.java:18) ~[?:?]
	at net.minecraft.network.protocol.game.ServerboundSetCreativeModeSlotPacket.handle(ServerboundSetCreativeModeSlotPacket.java:12) ~[?:?]
	at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1342) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1319) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1312) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1290) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1178) ~[paper-1.19.4.jar:git-Paper-550]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-550]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
@ItsShamed
Copy link
Owner

Yup this is because I haven't updated locales for a while. I'll try to find a new locales file. Hang on.

@ItsShamed
Copy link
Owner

May I ask you what Minecraft version are using ? So that I can decide if I only update the locales or can bump the dependencies as well.

@ItsShamed
Copy link
Owner

Should be fixed? Not closing this issue until I have confirmation that the changes that I made are indeed fixing this issue. (Cannot spin up test server right now)

@TheKrafter
Copy link
Author

Oh, I have this plugin running on two servers:

  • git-Paper-550 (MC: 1.19.4)
  • git-Paper-388 (MC: 1.18.2)

@TheKrafter
Copy link
Author

(And I'll close this once I have time to confirm it worked)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants