Closed nyvlunx closed 3 years ago
There is indeed a non-standard enchant in the splatter maps. This being said, the enchant is correctly registered into Bukkit, so tools processing the items should be able to process them correctly.
Proof of that, I created an NBT-aware multiple-inventories plugin, saving and restoring items including weird ones, and there is no problem processing these enchanted items.
I will look into Bukkit/Spigot/Minecraft code to check if there is something I can do about that.
@AmauryCarrade The problem is the lazy registration of the Enchantment in the getGlow
method of zLib.
How to reproduce:
getEnchantments()
method: TestPlugin/tomap
command to get a map item (which is enchanted with the GlowEffect)getGlow
from registering the enchantment)getEnchantments()
method on the enchanted map in your hand (in my TestPlugin execute /ptest
)How to fix: Rewrite the GlowEffect
class to require an explicit registration (maybe with a static variabe), before it can be used. Now every Plugin should call the registration method in it's onEnable
method.
Nice catch, thanks for digging out. That should be easy to fix. Not in a static variable, else, it will not be executed at startup but the first time the class loads; instead, in zLib's startup process.
Oh, I didn't see, that zLib has a startup process.
But be aware, that uninstalling this plugin can cause the same exception. Maybe the glowing effect can be better achieved with a nonsense enchant (like Infinity on anything except Bows) and hiding the enchant attribute.
Hello, I got some error,
I was in creative mode : https://pastebin.com/CT8hpebM
Then I looked if it was related to denizen in this issues : https://github.com/DenizenScript/Denizen-For-Bukkit/issues/1720 The answer was
You somehow have a nonsense item with invalid enchantments on it, which Spigot internals then crash on because they can't process the item.
Regards