mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-01 07:30:43 +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:
@ -31,11 +31,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
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:slab_" .. subname, {
|
||||
@ -56,11 +52,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
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 .. ":slab_" .. subname .. "_quarter", {
|
||||
@ -82,11 +74,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
||||
},
|
||||
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 .. ":slab_" .. subname .. "_three_quarter", {
|
||||
@ -108,11 +96,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5},
|
||||
},
|
||||
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 .. ":slab_" .. subname .. "_1", {
|
||||
@ -134,11 +118,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
|
||||
},
|
||||
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 .. ":slab_" .. subname .. "_2", {
|
||||
@ -160,11 +140,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
|
||||
},
|
||||
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 .. ":slab_" .. subname .. "_14", {
|
||||
@ -186,11 +162,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0.375, 0.5},
|
||||
},
|
||||
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 .. ":slab_" .. subname .. "_15", {
|
||||
@ -212,11 +184,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
|
||||
},
|
||||
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