kangarko / Foundation

Foundation™ helps you create highly customized Minecraft plugins (based on Spigot/Paper API) that support multiple MC versions.
https://mineacademy.org
305 stars 63 forks source link

Enchantment display error #283

Closed Takivad11 closed 3 months ago

Takivad11 commented 3 months ago

Version: 1.20.4

Error: Not exactly getting errors in console, but, i made a new Custom Enchantment, and with ProtocolLib it's displaying the Lore text in game, but if i mix the enchants on a anvil, for example, it will duplicate the text (functionality works perfectly fine, just text error)

Here you have an example

Before mixing on the anvil: image

After mixing on the anvil: image

As you can see the Ender Safety II text remains, and after digging into the code a bit, i think the thing is that in the addEnchantmentsLore method you should check if the custom enchant already has some lore written before adding the new one and then deleting it in case it does have it (not sure if it's the actual solution tho)

kangarko commented 3 months ago

Thank you for reporting. This is a minor issue I at present have no time for unfortunately. Foundation is open source, contributions are welcome. You are right that it has to do with the addEnchantmentsLore() method in the packets handler class. Feel free to make a pull request.