enchanted book (precise detection on server)
superon opened this issue ยท 2 comments
HQM-1.16.5-5.5.16-fabric
fabric-api-0.42.0+1.16
modloader 0.11.7
having a problem attempting to setup a redemption for a specific enchanted book, it appears to work fine in single player but when put onto a dedicated server it fails, not allowing the book to be handed on to complete the task.
the option to redeem a book works as expected afaik, just doesn't like handing them in via consume tasks.
Tested it out and figured out the issue: When the item tag is loaded from json, the level tag on the enchantment book is loaded as a byte tag, when it is supposed to be a short tag. Because of that, the usual equality check will fail.
I'd expect this issue to be present for all versions of HQM being maintained. This issue shouldn't have anything to do with client vs server.Rather, this issue appears when the item is loaded from quest data, as opposed to when it has been set through the editing screen.
Similarly to #643, this is a symptom of a larger problem. While the json and nbt structures are similar, thay are not entierly compatible with each other. For example, the nbt format has numbered array types alongside list types, unlike json. Perhaps more importantly (and what has led to this issue), nbt has number types, where json only has one universal number type.
This particular issue can be fixed with a custom nbt equality function that considers number tags to be equal only if their values are equal, without also expecting the number types to be the same.
However, the larger problem may still cause some special-case issues by for example misshaping item tags for quest reward items or bags.
A fix was backported in b9a5443 and is now available in HQM-1.16.5-5.5.17.