mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Add secondary screwdriver support for stairs
This commit is contained in:
parent
5fd746710f
commit
644187e204
1 changed files with 25 additions and 0 deletions
|
@ -121,6 +121,31 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript
|
|||
|
||||
return place_stair(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
on_rotate = function(pos, node, user, mode, param2)
|
||||
-- Flip stairs vertically
|
||||
if mode == screwdriver.ROTATE_AXIS then
|
||||
local minor = node.param2
|
||||
if node.param2 >= 20 then
|
||||
minor = node.param2 - 20
|
||||
if minor == 3 then
|
||||
minor = 1
|
||||
elseif minor == 1 then
|
||||
minor = 3
|
||||
end
|
||||
node.param2 = minor
|
||||
else
|
||||
if minor == 3 then
|
||||
minor = 1
|
||||
elseif minor == 1 then
|
||||
minor = 3
|
||||
end
|
||||
node.param2 = minor
|
||||
node.param2 = node.param2 + 20
|
||||
end
|
||||
minetest.set_node(pos, node)
|
||||
return false
|
||||
end
|
||||
end,
|
||||
_mcl_hardness = hardness,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue