Move mcl_util.get_wielded_item to mcl_deathmessages
This commit is contained in:
parent
78692181c0
commit
127de8e4d6
@ -641,15 +641,6 @@ function mcl_util.get_inventory(object, create)
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_util.get_wielded_item(object)
|
||||
if object:is_player() then
|
||||
return object:get_wielded_item()
|
||||
else
|
||||
-- ToDo: implement getting wielditems from mobs as soon as mobs have wielditems
|
||||
return ItemStack()
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_util.get_object_name(object)
|
||||
if object:is_player() then
|
||||
return object:get_player_name()
|
||||
|
@ -131,9 +131,18 @@ mcl_death_messages = {
|
||||
},
|
||||
}
|
||||
|
||||
local function get_wielded_item(object)
|
||||
if object:is_player() then
|
||||
return object:get_wielded_item()
|
||||
else
|
||||
-- ToDo: implement getting wielditems from mobs as soon as mobs have wielditems
|
||||
return ItemStack()
|
||||
end
|
||||
end
|
||||
|
||||
local function get_item_killer_message(obj, messages, reason)
|
||||
if messages.item then
|
||||
local wielded = mcl_util.get_wielded_item(reason.source)
|
||||
local wielded = get_wielded_item(reason.source)
|
||||
local itemname = wielded:get_meta():get_string("name")
|
||||
if itemname ~= "" then
|
||||
itemname = "[" .. itemname .. "]"
|
||||
|
Loading…
x
Reference in New Issue
Block a user