From 6817a8535b1c05bdb1de698335387fe027a1c384 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Mon, 3 Apr 2023 17:50:48 +0100 Subject: [PATCH] Get item name correctly. --- mods/ENTITIES/mcl_item_entity/init.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 218689059..3103a1104 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -409,11 +409,8 @@ local function nodes_destroy_items (self, moveresult, def, nn) local dg = minetest.get_item_group(nn, "destroys_items") if (def and (lg ~= 0 or fg ~= 0 or dg == 1)) then - local item_name = self.itemstring - local name, _ = item_name:match"^(%S+)%s+(.+)" - if name then - item_name = name - end + local item_string = self.itemstring + local item_name = ItemStack(item_string):get_name() --Wait 2 seconds to allow mob drops to be cooked, & picked up instead of instantly destroyed. if self.age > 2 and minetest.get_item_group(item_name, "fire_immune") == 0 then