RockinChaos / ItemJoin

Get custom items on join.
https://www.craftationgaming.com/
GNU Lesser General Public License v3.0
140 stars 36 forks source link

Do not strip custom enchants from items. #455

Open ryantheleach opened 2 years ago

ryantheleach commented 2 years ago

Thanks for taking the time to open a feature request!

Is your feature request related to a problem? Please describe. Various plugins implement custom enchants by registering into the base game.

Describe the solution you'd like I would like ItemJoin to not strip enchantments, and support enchantments from namespaces other then Minecraft.

Describe alternatives you've considered Forking ItemJoin.

RockinChaos commented 2 years ago

I know this is marked as a feature request, however ItemJoin should already support this as it does scan the namespaces to check for custom enchantments. Is there an example plugin I can download which will replicate this? For example, TokenEnchant and AdvancedEnchants work as intended.

ryantheleach commented 2 years ago

https://github.com/oddlama/vane/

For what it's worth, not all plugins are going to be hooking into the base game for custom enchants. It may have more to do with the fact that vane declares a custom-namespace, as mods/plugins/datapacks are encouraged to do so by Mojang.

As TokenEnchant and AdvancedEnchant are both premium, without resorting to piracy to decompile them, it's impossible to ascertain whether they "correctly" register the enchantments with the underlying base game, or fake the enchantment in some manner.

I have tried to serialize an item in game, but IJ refuses to enchant the the item or load it.

It also complains whenever the configuration is reloaded.

It's my suspicion that if Bukkit or SNBT serialization was used, that would provide a convenient fallback compatibility way of storing items.

Granted, it wouldn't be as easy for users to configure, but if SNBT was used, in some ways configuration would become trivial, as several sites can now generate NBT items.

RockinChaos commented 2 years ago

Ah I see, okay perfect. This is exactly what I needed to know. I will do some testing and update you here as I progress on this feature request.

Its been a while since I had added support for custom enchants so it does sound like some compatibility is missing from ItemJoin.

ryantheleach commented 2 years ago
  item_5:
    id: DIAMOND_SWORD
    lore:
    - '&8Soulbound'
    properties: 'Enchantments:[{id: "vane_enchantments:soulbound", lvl:1s}]'

For what it's worth, if it was possible to provide enchantments via properties, this is what I would expect.