0
0
Fork 0

Can flip slabs with screwdriver

This commit is contained in:
Wuzzy 2019-12-09 19:09:44 +01:00
parent da47d7917c
commit 26ac17f1ad
1 changed files with 19 additions and 1 deletions

View File

@ -143,7 +143,7 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript
node.param2 = node.param2 + 20
end
minetest.set_node(pos, node)
return false
return true
end
end,
_mcl_hardness = hardness,
@ -262,6 +262,15 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
end,
_mcl_hardness = hardness,
_mcl_other_slab_half = upper_slab,
on_rotate = function(pos, node, user, mode, param2)
-- Flip slab
if mode == screwdriver.ROTATE_AXIS then
node.name = upper_slab
minetest.set_node(pos, node)
return true
end
return false
end,
}
minetest.register_node(":"..lower_slab, slabdef)
@ -280,6 +289,15 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
topdef._doc_items_usagehelp = nil
topdef.drop = lower_slab
topdef._mcl_other_slab_half = lower_slab
topdef.on_rotate = function(pos, node, user, mode, param2)
-- Flip slab
if mode == screwdriver.ROTATE_AXIS then
node.name = lower_slab
minetest.set_node(pos, node)
return true
end
return false
end
topdef.node_box = {
type = "fixed",
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},