From 4b4e10ff1d4f1bde96c47331738e4af27bec6142 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 7 Nov 2013 22:16:37 -0500 Subject: 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 :-) --- stairsplus/panels.lua | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) (limited to 'stairsplus/panels.lua') 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) -- cgit v1.2.3