mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-07-16 04:30:23 +02:00
add an after_unexpand hook to allow beds to properly expand and unexpand, and update beds to use expansion in the process
This commit is contained in:
@ -77,8 +77,10 @@ function homedecor.register(name, def)
|
||||
end
|
||||
end
|
||||
|
||||
local expand = def.expand
|
||||
local expand = def.expand
|
||||
def.expand = nil
|
||||
local after_unexpand = def.after_unexpand
|
||||
def.after_unexpand = nil
|
||||
|
||||
if expand then
|
||||
def.on_place = def.on_place or function(itemstack, placer, pointed_thing)
|
||||
@ -115,6 +117,10 @@ function homedecor.register(name, def)
|
||||
minetest.remove_node(forward_pos)
|
||||
end
|
||||
end
|
||||
|
||||
if after_unexpand then
|
||||
after_unexpand(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user