PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
54 stars 21 forks source link

Item corruption 2.4.22 #1332

Closed vdl19 closed 2 years ago

vdl19 commented 2 years ago

Terms

Discord tag (optional)

No response

What happened?

Hello, I am using the generic coupons as physical currency on my server, I have edited the images and ecla has been working fine for quite a while. but on my test server since I installed version 2.4.22 my 1000 Gyls coins no longer work to buy from Shopkeepers while the 100 and 10 coins do. I checked on my official server no problem. I tried to put 2.4.20 back on my test server but it's the same. So I put 2.4.20 and I also copy the complete itemsadder folder from my official server on my test server by just changing: "server-ip:" and "pack-port:" to match. Here the new 1000 coins that I give myself work but not the 1000 that I had released since 2.4.22

Steps to reproduce the issue

  1. I had version 2.4.20 with coupons that I named 1000 Gyls and changed the image for a long time
  2. I just installed version 2.4.22 and tried using the coupons (1000 coin) to buy from a Shopkeeper that was set up with 1000 coupons for a long time and he didn't want to take them. account to pay. (he took the 100 Gyls and 10 Gyls well)
  1. By reverting to version 2.4.20 the 10x100 Gyls created with 2.4.22 no longer worked with hopkeepers and 64x1000 made with 2.4.20 worked with shopkeepers

Server version

This server is running Paper version git-Paper-388 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 22aaf91)

ItemsAdder Version

ItemsAdder version 2.4.20

ProtocolLib Version

ProtocolLib version 4.7.1-SNAPSHOT-b536

LoneLibs Version

LoneLibs version 1.0.15

LightAPI Version (optional)

No response

LibsDisguises Version (optional)

LightAPI version bukkit-5.0.0 (build SNAPSHOT)

FULL server log

2021-11-25-18 (2.4.22).log

Error (optional)

No response

ItemsAdder config.yml

No response

Problematic items yml configuration file (optional)

No response

Other files, you can drag and drop them here to upload. (optional)

No response

Screenshots/Videos (you can drag and drop files or paste links)

The 32 piece 1000 Gyls packs are the ones I have with version 2.4.20 now they can be bundled together. the pack of 10 x 1000 Gyls cannot mix with the 2 x 32 Gyls. The 10x 100 Gyls are the parts I got after putting version 2.4.22 on the server and kept before going back to 2.4.20.

image

Here is the information that appears when you are on it, no difference in appearance but it is not compatible now. I did not touch their configuration at all, nor rename or anything else I have always left it like this since I set them up several months ago it can be 1 year now

image

LoneDev6 commented 2 years ago

Shopkeepers is known to have problems with items sometimes, not only when used with ItemsAdder. This is because it uses the in-game Villagers trading system.

This trading system won't work if the item is not the 100% exact same of the recipe one. In this case I suspect the two items have NBT data identical but properties are rearranged. You can test it by taking 1 item from the "broken" Shopkeepers recipe and take the same item from ItemsAdder using the /iaget command. The use /iatag while holding the first item then the use it again with the second one. Now check and see the NBT tags are not in the same order, surely.

This is both a Spigot and Minecraft itself limitation I cannot fix in any way. The only way you have to avoid this is changing the Shopkeepers plugin to something more advanced which supports ItemsAdder (for now I cannot advice one since I don't think it exists, might be worth contacting one of the authors to get native ItemsAdder support) and doesn't use Villagers trading GUI or you can create a new trading recipe for these items which are not recognized (I did this back in the day when I had a server).

vdl19 commented 2 years ago

Hi thank you for the explanations I was able to verify that it is the way Minecraft that Shopkeeper works that poses the problem of purchases / sales, I have another plugin that I use for the bank which accepts both currencies.

The concern is that it does not only affect the economy of the blow, my banker can solve this even if it will not be terrible for the players it is doable. There will still be the concern of repurchasing items from the previous version which will no longer work unless perhaps a converter shopkeeper is made .....

But there is another concern it is in relation to the equipment and ores that the players have already mined and in stock!

I have just made tests with the repair for example with the items of 2.4.20 and then of 2.4.23 that I separated:

So I tested while being in 2.4.23 A. There it works everything is in 2.4.23 B. a piece of armor made with 2.4.23 cannot be repaired with a ruby ​​recovered in 2.4.20 C. the rubies of 2.4.20 are therefore unusable they no longer allow you to craft armor or other items. D. An armor from 2.4.20 can be repaired by rubies from 2.4.23

So the big concern is that all ores up to 2.4.20 that players have in stock are now unusable.

I understood the problem of the management of the NBT of minecraft but it is a problem for the ores too ...

image

vdl19 commented 2 years ago

Not logical, I can craft a piece of armor with the Rubies of 2.4.20 and 2.4.23 but therefore not repair with those of 2.4.20 So it's not manageable and not possible to tell that to the players! I don't see how I'm going to do it. The only thing possible is to stop updating and stop at 2.4.20! Hoping that ItemsAdder 2.4.20 is compatible with future versions of Minecraft because I upgrade my server to each new version after a few months of testing.

image

vdl19 commented 2 years ago

Last night I thought about it and I think that problems are surely possible with also all the recipes that use AI items such as kitchen recipes, I have not yet tested but it seems logical since my Shopkeeper buyers did not recognize tomatoes, bananas etc. 2.4.20 once switch to 2.4.23

vdl19 commented 2 years ago

Otherwise I think, as there are plugins that change functions or add them to the anvil, enchantment table, workbench ... wouldn't it be possible for you to add a layer the anvil, the furnace and the villagers' purchasing system (maybe others) to take charge of NBTs for itemsadder? For the trade I will maybe use the plugin that I had modified for my bank which is a DTLtrader trade plugin I must be able to do both without it being a nuisance, but this will only solve the concern of the trade not of the repair, the furnace and anvil

vdl19 commented 2 years ago

I will try to make crafts with these various items that I got in 2.4.20, I put 2.4.23 and I will see if I can craft with or not in 2.4.23. Ha yes there is also the oven which comes into account in the use of AI items. I have to be away I will do the tests when I get home I will tell you what that gives.

image

vdl19 commented 2 years ago

The items I got in 2.4.20 and which need the oven no longer work in 2.4.23

image

vdl19 commented 2 years ago

All the other 2.4.20 items that I used in the workbench work in 2.4.23. So what I think I can conclude about the problems:

LoneDev6 commented 2 years ago

All the issues you've listed can be resumed with my first answer, this is a Minecraft problem itself, even if the items look the same they can have NBT properties with different order and the game will think they are different items.

As I said please provide /iatag of two items (one obtained before update, another obtained after update).

The use /iatag while holding the first item then the use it again with the second one.

So please for example try this with the items you're trying to smelt in the furnace and send the results here. (Please send then as text not screenshots, you can get the output in console).

I'm thinking to introduce an auto updater for the old items in players inventories and chests, but this will introduce other problems: performance issues and low reliability

vdl19 commented 2 years ago

Hello, yes no worries I understood that it just shows what you had explained to me, I preferred to already give you my tests that I needed to do to see what it will affect in my players before trying can be the update on the official server or find solutions before updating and I needed to know which items were affected and how, I did not have time to retrieve the / iatag I had a request to test a plugin in the meantime. I put you a file where I put several items with their tag 2.4.20 then 2.4.23. Thank you

IA ITEMS nbt.txt

LoneDev6 commented 2 years ago

Yes for example the Ruby sword NBT lore 2.4.20: display:{Lore:['{"text":""}','{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Dans la main principale:"}],"text":""}'..........

2.4.23 display:{Lore:['{"text":""}','{"italic":false,"color":"gray","text":"Dans la main principale:"}','{"italic":false,"extra":[{"color":"dark_green","text":"7 points d\\u0027attaque"}],"text":" "}'......

The order of NBT attributes is different but the lore itself is displayed in the same way ingame. This is why you cannot use these items in some places. This is why I coded the ItemsAdder API which allows developers to know if an item equals to another by checking its internal ID.

I sadly don't have a solution for this because the game is made in a way which doesn't allow to easily handle this kind of issues. The only way to fix this situation is ask the authors of the other plugins to add native ItemsAdder support using the free Java API (they can ask me a free copy if needed) or create a shop which accepts various "broken" items and returns "fixed" ones (that's what I did in my old server).