DemonBoiAnzu / ItemQualities

A plugin that adds Qualities to Items, along with the ability for the user to create their own.
MIT License
10 stars 2 forks source link

Incompatible with custom enchant plugins #16

Open HenryEwald opened 2 years ago

HenryEwald commented 2 years ago

Holding an item with custom enchants on it removes the enchants. To reproduce put a custom enchant on any item and then hold it. Using Purpur 1.19 with build 1.1.0

DemonBoiAnzu commented 2 years ago

Not sure if there's anything I can do about this, honestly.

What plugin is it? How are the custom enchants applied? My plugin doesn't remove anything from the item except for tags owned by the plugin itself, and an items lore so it can display Quality information. If the enchant displays are removed from the lore, I don't see how that would cause the enchantments not to function.

Did you test if the enchantments still functioned when they were "removed" by my plugin?

HenryEwald commented 2 years ago

This happens with excellent enchants and enchants squared. The enchant plugins seam to be registering enchants based on the item's lore, are you adding too or setting the item's lore? A solution could be a config to disable item lore display.

fahlur commented 2 years ago

This happens with excellent enchants and enchants squared. The enchant plugins seam to be registering enchants based on the item's lore, are you adding too or setting the item's lore? A solution could be a config to disable item lore display.

@Steel-Dev I can verify that Excellent Enchantment plugin works perfectly fine with ItemQualities. However the lore is in fact removed. The plugin does NOT require the lore to function, however an aesthetic is lost, a rather important one for the player to know what enchantment(s) is on the item. My recommendation to the developer would be to check for an existing lore, then readd it with the quality.

Sparky200 commented 2 years ago

I can verify that Excellent Enchantment plugin works perfectly fine with ItemQualities. However the lore is in fact removed. The plugin does NOT require the lore to function, however an aesthetic is lost, a rather important one for the player to know what enchantment(s) is on the item. My recommendation to the developer would be to check for an existing lore, then readd it with the quality.

I assume what you're looking for is the ability to unite both plugins' lore changes, so you can have the item qualities display as well as the custom enchants?

The plugins which use the lore in order to recognize an enchantment aren't designed in the best way but it sounds like the plugin you're using should be patchable.

fahlur commented 2 years ago

I can verify that Excellent Enchantment plugin works perfectly fine with ItemQualities. However the lore is in fact removed. The plugin does NOT require the lore to function, however an aesthetic is lost, a rather important one for the player to know what enchantment(s) is on the item. My recommendation to the developer would be to check for an existing lore, then readd it with the quality.

I assume what you're looking for is the ability to unite both plugins' lore changes, so you can have the item qualities display as well as the custom enchants?

The plugins which use the lore in order to recognize an enchantment aren't designed in the best way but it sounds like the plugin you're using should be patchable.

both plugins could do either, If you perform the enchants first then do the item quality, it works perfectly fine and they both show. So yea its easily doable in the end. just have to actually have it update accordingly when adding the qualities to an existing enchanted item with custom enchants or lore.

the enchantment plugin I mentioned does not require the lore at all, the lore is gone but the enchants work. This is because you can register custom enchants to minecraft. Im aware of this because ive made custom enchants in the past, the lore is 100% cosmetic and non functional outside of telling the player the enchant is on the tool/armor bit.

edit: The durability update thing seems to update that part of the lore as well ofc.

Also to note, again, the enchantment plugin does NOT rely on lore. I know this is a funcitonal thign via code as a large portion of my own plugin base is my own custom coded plugins and with addition of ones I personally have custom branches of for more features. They store the enchantments via the enchantment api system that exists for the last few versions or so of minecraft. A perfect indicator them doing this is the lore does not have enchants on them and the enchants still work. for example

fahlur commented 2 years ago

So.. cough... temp removed the item qualities plugin. All items with the quality lore. Worked perfectly with the enchant plugin , didnt even Hide the enchants, actually the enchantment plugin worked PERFECTLY with lore from other plugins, it took the item quality lore in account and worked with it accordingly. I do know that when I moved items with item quality around it updated. Which told me Item Qualities is updating itself. Which tells me inventory change event is triggered and the qualities are being updated despite already having a quality..?

DemonBoiAnzu commented 2 years ago

So.. cough... temp removed the item qualities plugin. All items with the quality lore. Worked perfectly with the enchant plugin , didnt even Hide the enchants, actually the enchantment plugin worked PERFECTLY with lore from other plugins, it took the item quality lore in account and worked with it accordingly. I do know that when I moved items with item quality around it updated. Which told me Item Qualities is updating itself. Which tells me inventory change event is triggered and the qualities are being updated despite already having a quality..?

They're being updated despite already having a Quality because it's refreshing the item. Mainly just in case the Quality the items has had has some changes to its json file and the plugin reloaded/server restarted, so the item would reflect said changes.

As for it removing lore - yes, as of right now, it clears the items lore and populates it with my own lore, I wasn't really thinking people would have other things that change the lore at the time (was going to change it at a later date, just wasn't a priority) But, due to the item being refreshed, I'm not able to just add the lore to it, as it'd end up duplicating what the item already has over and over, and checking if the item already has said line is just dumb. I'll think of a solution.

DemonBoiAnzu commented 2 years ago

There really isn't much I can do as both my plugin and all custom enchantment plugins edit the items lore directly.

Only solution I can really do is completely remove the display of Quality information in the items lore, but I don't want to do that because that data is important to display to the user.

If someone can make a PR to patch this issue, feel free. I myself am unable to, really. Mostly because I can't at all find a solution to support these.

Since any custom enchantment plugins uses lore to display their enchantments (vanilla enchantments don't, fun fact) since it's impossible for them to display enchantments like the vanilla ones do (because it's the client displaying it, but the client doesn't know of said custom enchantments existence, and hence doesn't know how to display them like it does vanilla enchantments)

If I were to ADD to the lore instead of setting, it'd cause another major issue, which is constantly repeating the same lore over and over to the point where so much duplicated information would display and the lore tooltip would go off-screen.

So, there's really no way I can properly fix the lore issue.