diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua index 6337941..1a503e9 100644 --- a/mesecons_pressureplates/init.lua +++ b/mesecons_pressureplates/init.lua @@ -42,8 +42,18 @@ end -- tiles_on: textures of the pressure plate when active -- image: inventory and wield image of the pressure plate -- recipe: crafting recipe of the pressure plate +-- groups: groups +-- sounds: sound table + +function mesecon.register_pressure_plate(basename, description, textures_off, textures_on, image_w, image_i, recipe, groups, sounds) + local groups_off, groups_on + if not groups then + groups = {} + end + local groups_off = table.copy(groups) + local groups_on = table.copy(groups) + groups_on.not_in_creative_inventory = 1 -function mesecon.register_pressure_plate(basename, description, textures_off, textures_on, image_w, image_i, recipe) mesecon.register_node(basename, { drawtype = "nodebox", inventory_image = image_i, @@ -56,17 +66,18 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te on_construct = function(pos) minetest.get_node_timer(pos):start(mesecon.setting("pplate_interval", 0.1)) end, + sounds = sounds, },{ mesecons = {receptor = { state = mesecon.state.off, rules = mesecon.rules.pplate }}, node_box = pp_box_off, selection_box = pp_box_off, - groups = {snappy = 2, oddly_breakable_by_hand = 3}, + groups = groups_off, tiles = textures_off },{ mesecons = {receptor = { state = mesecon.state.on, rules = mesecon.rules.pplate }}, node_box = pp_box_on, selection_box = pp_box_on, - groups = {snappy = 2, oddly_breakable_by_hand = 3, not_in_creative_inventory = 1}, + groups = groups_on, tiles = textures_on }) @@ -83,7 +94,9 @@ mesecon.register_pressure_plate( {"jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on_edges.png"}, "jeija_pressure_plate_wood_wield.png", "jeija_pressure_plate_wood_inv.png", - {{"group:wood", "group:wood"}}) + {{"group:wood", "group:wood"}}, + { choppy = 3, oddly_breakable_by_hand = 3 }, + default.node_sound_wood_defaults()) mesecon.register_pressure_plate( "mesecons_pressureplates:pressure_plate_stone", @@ -92,4 +105,6 @@ mesecon.register_pressure_plate( {"jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on_edges.png"}, "jeija_pressure_plate_stone_wield.png", "jeija_pressure_plate_stone_inv.png", - {{"default:cobble", "default:cobble"}}) + {{"default:cobble", "default:cobble"}}, + { cracky = 3, oddly_breakable_by_hand = 3 }, + default.node_sound_stone_defaults())