ItemJoin

ItemJoin

157k Downloads

[Bug] Unrecognized older custom items

momoservertw opened this issue ยท 4 comments

commented

Sometimes, custom items will become invalid items, and impossible to run commands.
I guess it happened after I updated the plugin. And this issue has continually exist since version 5.0.1-SNAPSHOT.

I use CMI's command to look at the item's NBT information. The value of "ItemJoin Slot (String): ArbitraryOO" is difference between the new item and old item. I do not sure this problem involve the database, because I often use creative mode to copy the item, update the plugin version and change the item list.

New items
image
Older items (invalid)
image

ItemJoin version: 5.0.3-SNAPSHOT (#212)
Paper version: git-Paper-522 (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT) (latest)

commented

There was a major bug in the rework from v5.0.0 until resolved in v5.0.3-SNAPSHOT. (#213). I had fixed the error and it caused any old items to become invalid. This is because the player datafile would fail to be reset upon regenerating the config files (each time on boot and /ij reload). Which created this very very high Arbitrary slot numbers hence why it says 37 instead of 1. Upon starting the server after a full stop, the old item would be recognized again which is what is suppose to happen, but ItemJoin is not supposed to continuously increase the arbitrary numbers for a static instance.

I am actually completely unsure if it is even possible to allow old items to function once more along with the new items "fixed".

Somehow this bug got through during the testing phases (or there were just a minimal amount of people testing it) and I didn't notice it until I made an arbitrary item animate/dynamic, then reloaded the configs and rejoined which ended up giving me new animated items. Wasn't until inspecting the NBT elements that I realized the math was off.

I will try to see what I can do but I am afraid if I create an instance where this bug exists (if it doesn't recognize it as a new item) then it will possibly open up the opportunity for exploits.

commented

I can confirm that there is no way to allow both the old items and the new items to function at the same time. The issue is, the items that were generated "bugged" would only function for that session only. Once the server is reloaded, they would never work again. This is based on the number of times the item was interacted with for that session (making it impossible to really know what its true arbitrary value is). Its basically a randomly generated number that isn't recognizable.

The only thing that "could" be theoretically possible is that (in-order) I could try to have ItemJoin search for the arbitrary values and compare them to the order the items are in the items.yml. However, the issue is that this could allow the item to function (as a different item) if it guesses incorrectly.

I also could add a boolean value to the config.yml that will completely ignore the NBT tags of already existing items if that is something of interest.

Let me know.

commented

Ok, I will test it as soon as possible. Recently, my school work is busy. Thank you! :)

commented

This main [root] of this issue has been officially fixed in the release of ItemJoin v5.0.3.
Old items that were generated between versions v5.0.0-v5.0.1 will not work if they are arbitrary and will have to be regenerated. Older versions below v5.0.0 will function as normal though.

You can grab it here; https://www.spigotmc.org/resources/itemjoin.12661/download?version=262715

Please read the changelog as the documentation has not been updated yet;
https://www.spigotmc.org/wiki/recent-changes

If there is anything else you need to add to this issue please re-open it and I will assist you further!