aboutsummaryrefslogtreecommitdiff
path: root/stairsplus/panels.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-11-07 22:16:37 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-11-07 22:16:37 -0500
commit4b4e10ff1d4f1bde96c47331738e4af27bec6142 (patch)
tree3d5a07f680e0b7eef590a995de480fae1cff2d61 /stairsplus/panels.lua
parent524dcb1396aa9df0f60c6f74d91c2e24c19e9ad6 (diff)
downloadmoreblocks-4b4e10ff1d4f1bde96c47331738e4af27bec6142.tar.gz
moreblocks-4b4e10ff1d4f1bde96c47331738e4af27bec6142.tar.bz2
moreblocks-4b4e10ff1d4f1bde96c47331738e4af27bec6142.zip
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/panels.lua')
-rw-r--r--stairsplus/panels.lua42
1 files changed, 7 insertions, 35 deletions
diff --git a/stairsplus/panels.lua b/stairsplus/panels.lua
index a5a9caa..c0a24fb 100644
--- a/stairsplus/panels.lua
+++ b/stairsplus/panels.lua
@@ -30,11 +30,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
},
- 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 .. ":panel_" .. subname .. "_1", {
@@ -55,11 +51,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5},
},
- 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 .. ":panel_" .. subname .. "_2", {
@@ -80,11 +72,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
},
- 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 .. ":panel_" .. subname .. "_4", {
@@ -105,11 +93,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5},
},
- 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 .. ":panel_" .. subname .. "_12", {
@@ -130,11 +114,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5},
},
- 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 .. ":panel_" .. subname .. "_14", {
@@ -155,11 +135,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5},
},
- 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 .. ":panel_" .. subname .. "_15", {
@@ -180,11 +156,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5},
},
- 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_alias(modname..":panel_"..subname.."_bottom", modname..":panel_"..subname)