diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2013-11-07 22:16:37 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2013-11-07 22:16:37 -0500 |
commit | 4b4e10ff1d4f1bde96c47331738e4af27bec6142 (patch) | |
tree | 3d5a07f680e0b7eef590a995de480fae1cff2d61 /stairsplus/slabs.lua | |
parent | 524dcb1396aa9df0f60c6f74d91c2e24c19e9ad6 (diff) |
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 :-)
Diffstat (limited to 'stairsplus/slabs.lua')
-rw-r--r-- | stairsplus/slabs.lua | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua index a7ebe43..1e251a5 100644 --- a/stairsplus/slabs.lua +++ b/stairsplus/slabs.lua @@ -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 |