mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-07-21 14:50:23 +02:00
allow chaining of on_construct instead of overwriting in registration function
This commit is contained in:
@ -24,10 +24,12 @@ function homedecor.register(name, def)
|
||||
local infotext = def.infotext
|
||||
--def.infotext = nil -- currently used to set locked refrigerator infotexts
|
||||
|
||||
if infotext and not def.on_construct then
|
||||
if infotext then
|
||||
local on_construct = def.on_construct
|
||||
def.on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("infotext", infotext)
|
||||
if on_construct then on_construct(pos) end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user