Log warning for non-serializable item entity fix

This commit is contained in:
Nils Dagsson Moskopp 2021-07-29 15:46:50 +02:00
parent 62d5b547a0
commit a0c9f11af6
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
1 changed files with 7 additions and 0 deletions

View File

@ -479,6 +479,13 @@ minetest.register_entity(":__builtin:item", {
local stack = ItemStack(self.itemstring)
stack:get_meta():from_table(nil)
self.itemstring = stack:to_string()
minetest.log(
"warning",
"Overlong item entity metadata removed: “" ..
self.itemstring ..
"” had serialized length of " ..
#data
)
return self:get_staticdata()
end
return data