mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-07-02 15:50:21 +02:00
Added on_rotate
It's possible to change axis with the screw driver. Note that It does not really use facedir but still use 3 pre-made orientations. Paramtype2 facedir is required for some screw driver to trigger on_rotate but it's not really used for the rotation.
This commit is contained in:
@ -6,6 +6,7 @@ minetest.register_node("mesecons_stickyblocks_linear:sticky_block_x", {
|
||||
description = "X Sticky Block",
|
||||
drawtype = "nodebox",
|
||||
drop = "mesecons_stickyblocks_linear:sticky_block_y",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
"mesecons_stickyblocks_linear.png",
|
||||
"mesecons_stickyblocks_linear.png",
|
||||
@ -37,12 +38,17 @@ minetest.register_node("mesecons_stickyblocks_linear:sticky_block_x", {
|
||||
minetest.swap_node(pos, {name = "mesecons_stickyblocks_linear:sticky_block_y" })
|
||||
end
|
||||
end,
|
||||
on_rotate = function(pos, node, player, pointed_thing)
|
||||
minetest.swap_node(pos, {name = "mesecons_stickyblocks_linear:sticky_block_y" })
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Y sticky block
|
||||
minetest.register_node("mesecons_stickyblocks_linear:sticky_block_y", {
|
||||
description = "Linear Sticky Block",
|
||||
drawtype = "nodebox",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
"mesecons_stickyblocks_linear_sticky.png",
|
||||
"mesecons_stickyblocks_linear_sticky.png",
|
||||
@ -74,12 +80,17 @@ minetest.register_node("mesecons_stickyblocks_linear:sticky_block_y", {
|
||||
minetest.swap_node(pos, {name = "mesecons_stickyblocks_linear:sticky_block_z" })
|
||||
end
|
||||
end,
|
||||
on_rotate = function(pos, node, player, pointed_thing)
|
||||
minetest.swap_node(pos, {name = "mesecons_stickyblocks_linear:sticky_block_z" })
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Z sticky block
|
||||
minetest.register_node("mesecons_stickyblocks_linear:sticky_block_z", {
|
||||
description = "Z Sticky Block",
|
||||
drawtype = "nodebox",
|
||||
paramtype2 = "facedir",
|
||||
drop = "mesecons_stickyblocks_linear:sticky_block_y",
|
||||
tiles = {
|
||||
"mesecons_stickyblocks_linear.png",
|
||||
@ -112,6 +123,10 @@ minetest.register_node("mesecons_stickyblocks_linear:sticky_block_z", {
|
||||
minetest.swap_node(pos, {name = "mesecons_stickyblocks_linear:sticky_block_x" })
|
||||
end
|
||||
end,
|
||||
on_rotate = function(pos, node, player, pointed_thing)
|
||||
minetest.swap_node(pos, {name = "mesecons_stickyblocks_linear:sticky_block_x" })
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
mesecon.rules.y = {
|
||||
|
Reference in New Issue
Block a user