From 521070541750a5913c6e83638c60ec3ff6ae79cd Mon Sep 17 00:00:00 2001 From: Jeija Date: Sun, 8 Jan 2012 18:23:44 +0100 Subject: Change Button Rules, Torch rules and split into multiple files. Object detectors with sign underneath only detect players with the name on it. --- jeija/pressureplates.lua | 151 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 jeija/pressureplates.lua (limited to 'jeija/pressureplates.lua') diff --git a/jeija/pressureplates.lua b/jeija/pressureplates.lua new file mode 100644 index 0000000..d894ff5 --- /dev/null +++ b/jeija/pressureplates.lua @@ -0,0 +1,151 @@ +-- PRESSURE PLATE WOOD + +minetest.register_node("jeija:pressure_plate_wood_off", { + drawtype = "raillike", + tile_images = {"jeija_pressure_plate_wood_off.png"}, + inventory_image = "jeija_pressure_plate_wood_off.png", + paramtype = "light", + is_ground_content = true, + walkable = false, + selection_box = { + type = "fixed", + }, + material = minetest.digprop_constanttime(0.3), +}) + +minetest.register_node("jeija:pressure_plate_wood_on", { + drawtype = "raillike", + tile_images = {"jeija_pressure_plate_wood_on.png"}, + inventory_image = "jeija_pressure_plate_wood_on.png", + paramtype = "light", + is_ground_content = true, + walkable = false, + selection_box = { + type = "fixed", + }, + material = minetest.digprop_constanttime(0.3), + dug_item='node "jeija:pressure_plate_wood_off" 1' +}) + +minetest.register_craft({ + output = 'node "jeija:pressure_plate_wood_off" 1', + recipe = { + {'node "default:wood"', 'node "default:wood"'}, + } +}) + +minetest.register_abm( + {nodenames = {"jeija:pressure_plate_wood_off"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + for k, obj in pairs(objs) do + local objpos=obj:getpos() + if objpos.y>pos.y-1 and objpos.ypos.y-1 and objpos.y