mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-04 17:10:40 +02:00
Rewrite slightly to use the new 6d facedir prediction code in builtin.
Keeps the old behavior of sneak == force wall (rather than invert). Add protection/ownership checking. Can be phased out later after protection mods start taking advantage of the engine's built-in ownershi-checking functions. Got rid of the /st command, since it didn't work anyway. Minor re-arrangement of init.lua to put the mod's title block at the top where it belongs :-)
This commit is contained in:
@ -36,11 +36,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
minetest.register_node(":stairs:stair_" .. subname, {
|
||||
@ -66,11 +62,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_half", {
|
||||
@ -97,11 +89,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
minetest.register_node(":"..modname .. ":stair_" .. subname .. "_right_half", {
|
||||
@ -128,11 +116,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
minetest.register_node(":"..modname .. ":stair_" .. subname .. "_inner", {
|
||||
@ -162,11 +146,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
minetest.register_node(":"..modname .. ":stair_" .. subname .. "_outer", {
|
||||
@ -194,11 +174,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt", {
|
||||
@ -218,11 +194,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local keys=placer:get_player_control()
|
||||
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
|
||||
return itemstack
|
||||
end
|
||||
on_place = stairsplus_rotate_and_place
|
||||
})
|
||||
|
||||
-- Unregister default recipes, optional, see _config.txt
|
||||
|
Reference in New Issue
Block a user