1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 16:30:21 +01:00

allow shift-dig a king size bed to get the two twin beds back

This commit is contained in:
Vanessa Ezekowitz 2015-04-22 04:34:51 -04:00
parent cc804c734d
commit 12cc9da08c

View File

@ -264,6 +264,13 @@ for _, color in ipairs(bedcolors) do
groups = {snappy=3, not_in_creative_inventory=1}, groups = {snappy=3, not_in_creative_inventory=1},
selection_box = kbed_cbox, selection_box = kbed_cbox,
collision_box = kbed_cbox, collision_box = kbed_cbox,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local inv = digger:get_inventory()
if digger:get_player_control().sneak and inv:room_for_item("main", "bed_"..color.."_regular 1") then
inv:remove_item("main", "homedecor:bed_"..color.."_kingsize 1")
inv:add_item("main", "homedecor:bed_"..color.."_regular 2")
end
end,
}) })
minetest.register_alias("homedecor:bed_"..color.."_foot", "homedecor:bed_"..color.."_regular") minetest.register_alias("homedecor:bed_"..color.."_foot", "homedecor:bed_"..color.."_regular")