mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-01 06:51:10 +01:00
29 lines
522 B
Lua
29 lines
522 B
Lua
MCLDamageSource = class()
|
|
|
|
function MCLDamageSource:constructor(tbl)
|
|
if tbl then
|
|
for k, v in pairs(tbl) do
|
|
self[k] = v
|
|
end
|
|
end
|
|
end
|
|
|
|
function MCLDamageSource:from_mt(reason)
|
|
|
|
end
|
|
|
|
MCLDamageSource:__getter("direct_object", function(self)
|
|
local obj = self.raw_source_object
|
|
if not obj then
|
|
return
|
|
end
|
|
return mcl_object_mgr.get(obj)
|
|
end)
|
|
|
|
MCLDamageSource:__getter("source_object", function(self)
|
|
local direct = self:direct_object()
|
|
if not direct then
|
|
return
|
|
end
|
|
return direct.source_object or direct
|
|
end)
|