GC-spigot / AdvancedEnchantments

Superior Custom Enchantments Creator for Minecraft And Spigot platform
139 stars 61 forks source link

[MMOItems] AE in custom_nbt is not cleared, when a blackscroll is used + Slot-increaser & KILL trigger bug #4299

Closed TheLaoming closed 1 month ago

TheLaoming commented 1 month ago

Describe the bug

Hey, so it's pretty simple. If you use AE enchant as custom_nbt on your MMOItem, like this:

custom-nbt:
    - ae_enchantment;soulbound 1

and you use blackscroll to remove it, it will remain in nbt written like this: MMOITEMS_CUSTOM_NBT:'["ae_enchantment;soulbound 1","EXTMI_ae_enchantment;soulbound 1"] Actually only the lore is removed, but nbt tag not. Would be amazing if you can check if MI custom_nbt contains ae enchant and clear it then, since people can't add more enchants in this case, and slot increasers is useless, because it says it reached max enchants on the item. Moreover, seems like there's again a bug where you can't use slot increaser, if your item doesn't have any AE enchants applied. If your item missing AE enchants, it does nothing when you try to apply slot increaser.

Also there's second issue I've found, but I don't really care much about this one (just wanted to report it). When you use KILL trigger with cooldown, it doesn't work with combination of any aoe format, BUT when you remove cooldown, it works just fine. Great example is default Kill Aura enchant. I've already fixed it using a different trigger, but here comes your issue.

How to reproduce

Variant 1:

Variant 2:

About bug with KILL trigger, just try default Kill Aura enchant in AE and then try without cooldown option, it will work just fine without it.

Screenshots / Videos

No response

"/ae plinfo" link

https://paste.md-5.net/ulepicuhix

Server Log

No response

ThomasWega commented 1 month ago

If I understand correctly, MMOItems creates some additional data and that one is not removed. I understand that might be frustrating, but I feel like this is more of MMOItems thing to handle, don't you agree? They can listen to our events

Indyuce commented 1 month ago

(Author of MMOItems) Yes, this is more of an issue with MMOItems. MMOItems have this feature where they save tags which have been found at any point in time, inside of the item NBT. This lacks compatibility with other plugins editing the item tags... I have planned on changing the way MMOItems handles generated ItemStacks so that the other NBTTags and persistent data are NOT modified, at all. Instead of regenerating the item from 0 everytime, tags will be modified, added and removed with more precision, which will greatly improve compatibility with AE

ThomasWega commented 1 month ago

Sounds good! If you need any help with compatibility between AdvancedPlugins and MMOPlugins, feel free to let us know what we can do! :)