Allow functions for mobs_debug
This commit is contained in:
parent
4fc7e61f28
commit
1ab378b248
@ -29,7 +29,11 @@ function mcl_mobs.mob_class:get_nametag()
|
|||||||
local name = self.nametag ~= "" and self.nametag or self.name
|
local name = self.nametag ~= "" and self.nametag or self.name
|
||||||
local elements = {}
|
local elements = {}
|
||||||
for _, k in ipairs(mcl_mobs_debug.fields_default) do
|
for _, k in ipairs(mcl_mobs_debug.fields_default) do
|
||||||
table.insert(elements, k.." = "..tostring(self[k]))
|
if type(k) =="function" then
|
||||||
|
table.insert(elements, k(self))
|
||||||
|
else
|
||||||
|
table.insert(elements, k.." = "..tostring(self[k]))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for _, k in ipairs(self._debug_fields or {}) do
|
for _, k in ipairs(self._debug_fields or {}) do
|
||||||
if type(k) == "function" then
|
if type(k) == "function" then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user