croabeast / advancementinfo Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Is there a way to get the displayed item in the advancement?
In version 1.20.3 they changed the achievements again and now to get display you need to access "c" again
Object display = NMSUtil.getObject(nmsAdv, IS_19_4 && !IS_20_3 ? "d" : "c");
[20:39:54 ERROR]: Could not pass event PlayerAdvancementDoneEvent to FlectonePulse v0.0.1
org.bukkit.event.EventException: null
at FlectonePulse-spigot-0.0.1.jar/net.flectone.pulse.core.model.AbstractBase.lambda$registerEvents$0(AbstractBase.java:108) ~[FlectonePulse-spigot-0.0.1.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:1.21-2252-d5c06b4]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.PlayerAdvancements.award(PlayerAdvancements.java:247) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.advancements.CriterionTrigger$Listener.run(CriterionTrigger.java:21) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.advancements.critereon.SimpleCriterionTrigger.trigger(SimpleCriterionTrigger.java:64) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.advancements.critereon.InventoryChangeTrigger.trigger(InventoryChangeTrigger.java:46) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.advancements.critereon.InventoryChangeTrigger.trigger(InventoryChangeTrigger.java:42) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.level.ServerPlayer$2.slotChanged(ServerPlayer.java:408) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.world.inventory.AbstractContainerMenu.triggerSlotListeners(AbstractContainerMenu.java:307) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.world.inventory.AbstractContainerMenu.broadcastChanges(AbstractContainerMenu.java:244) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleSetCreativeModeSlot(ServerGamePacketListenerImpl.java:3439) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.network.protocol.game.ServerboundSetCreativeModeSlotPacket.handle(ServerboundSetCreativeModeSlotPacket.java:30) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.network.protocol.game.ServerboundSetCreativeModeSlotPacket.handle(ServerboundSetCreativeModeSlotPacket.java:20) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:36) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1513) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1491) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1484) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1443) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1450) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1295) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:332) ~[purpur-1.21.jar:1.21-2252-d5c06b4]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
at FlectonePulse-spigot-0.0.1.jar/me.croabeast.advancementinfo.AdvancementInfo.getNmsClass(AdvancementInfo.java:61) ~[FlectonePulse-spigot-0.0.1.jar:?]
at FlectonePulse-spigot-0.0.1.jar/me.croabeast.advancementinfo.AdvancementInfo.getHandle(AdvancementInfo.java:74) ~[FlectonePulse-spigot-0.0.1.jar:?]
at FlectonePulse-spigot-0.0.1.jar/me.croabeast.advancementinfo.AdvancementInfo.<init>(AdvancementInfo.java:234) ~[FlectonePulse-spigot-0.0.1.jar:?]
at FlectonePulse-spigot-0.0.1.jar/net.flectone.pulse.core.module.server.message.advancement.AdvancementListener.playerAdvancementEvent(AdvancementListener.java:43) ~[FlectonePulse-spigot-0.0.1.jar:?
]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
at FlectonePulse-spigot-0.0.1.jar/net.flectone.pulse.core.model.AbstractBase.lambda$registerEvents$0(AbstractBase.java:106) ~[FlectonePulse-spigot-0.0.1.jar:?]
... 31 more
I don't know if it's possible to get the translated title and description (depending of the user's client language)
Hello, can you please add 2.3 version to the Maven?
How about adding two new objects translateTitle and translateDescription to the AdvancementInfo class, which will serve for TranslatableComponent?
I already use your code and I want to say thank you very much for it, but I had to modify it to get the important keys for translation
Object rawTitle = NMSUtil.getObject(display, "a");
Object rawDesc = NMSUtil.getObject(display, "b");
translateTitle = String.valueOf(NMSUtil.getObject(NMSUtil.getObject(rawTitle, "b"), "a"));
translateDesc = String.valueOf(NMSUtil.getObject(NMSUtil.getObject(rawDesc, "b"), "a"));
I will just leave this here as it is returning empty strings instead of errors, making it hard to find the culprit.
Get the hidden
property from the advancement
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.