mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-02-17 21:23:44 +01:00
Fix crashing if null itemstack enchant when player is hacking
This commit is contained in:
@ -6,6 +6,9 @@ function mcl_enchanting.is_book(itemname)
|
||||
end
|
||||
|
||||
function mcl_enchanting.get_enchantments(itemstack)
|
||||
if not itemstack then
|
||||
return({})
|
||||
end
|
||||
return minetest.deserialize(itemstack:get_meta():get_string("mcl_enchanting:enchantments")) or {}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user