Bernasss12 / BetterEnchantedBooks

Makes it easier to identify different enchantment books.
MIT License
12 stars 9 forks source link

[Crash] Enchant Book Item (no enchantment attached) #33

Closed MissGamerz closed 3 years ago

MissGamerz commented 3 years ago

Describe the bug A Hard Crash of minecraf based upon your tooltip for enchantments, the tooltip for showing what a enchantment can be applied to still seems to try to work if a enchantedbook with no enchantment data is in a Inventory the player opens. This can be aquired with (/give {name} enchanted_book 1) OR is sometimes used in custom GUIS on servers for click GUI Menus.

To Reproduce i managed to come across this whilst on my network running yatopia (a paper spigot fork) 1.16.5 whilst using the plugin customcrafting(it has a GUI configurator for making custom recipes and items in game and injects them on the fly) in customcraftings item creator page there is a enchantment book which has no enchantment data on it. this will crash the client.

Expected behavior it should not crash???????? and just treat the enchantment book as if it a normal item

Bernasss12 commented 3 years ago

Well I don't personally agree with your assessment of the expected behaviour since an enchanted book is supposed to have at least one enchantment but alas this will be a quick fix so expect it within a day hopefully.

MissGamerz commented 3 years ago

sorry i was trying to be funny, wasnt meant to be taken bad. but yea a catch for this and make the tooltip thing ignore it should fix this is quite common tbh in Custm GUIs on servers such as hypixel have them and so on and contain the enchantment book without NBT data

Bernasss12 commented 3 years ago

I didn't take it badly don't worry about it. Can you try to get me a log thought? I can't seem to reproduce the issue on my pc. (only really tried with the /give command)

MissGamerz commented 3 years ago

il will try there is going to be delay as we moves our networks node and database so sorry for any delay with this

Bernasss12 commented 3 years ago

Can you pleased test this again with the newest build? PR #34 Might've fixed it.

MissGamerz commented 3 years ago

this is fixed sorry for delay ive been away from github