diff options
author | Vitaliy <silverunicorn2011@yandex.ru> | 2018-07-18 01:37:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 01:37:45 +0300 |
commit | ff73d0e60f90fdb6f7a81fd1ac1c806ba7207c46 (patch) | |
tree | 208cfc212c0b354a312186ac92b9465aeeb66252 /mesecons_pressureplates | |
parent | 7013f2e5d47ff2d21fb66fe82966a34ece947eec (diff) | |
parent | 5ae33542274c96b956a505263e8b23e636b8f208 (diff) | |
download | mesecons-ff73d0e60f90fdb6f7a81fd1ac1c806ba7207c46.tar mesecons-ff73d0e60f90fdb6f7a81fd1ac1c806ba7207c46.tar.gz mesecons-ff73d0e60f90fdb6f7a81fd1ac1c806ba7207c46.tar.bz2 mesecons-ff73d0e60f90fdb6f7a81fd1ac1c806ba7207c46.tar.xz mesecons-ff73d0e60f90fdb6f7a81fd1ac1c806ba7207c46.zip |
Merge pull request #401 from Wuzzy2/sfx
Add missing sound effects and fix wrong pressure plate sounds
Diffstat (limited to 'mesecons_pressureplates')
-rw-r--r-- | mesecons_pressureplates/init.lua | 25 |
1 files changed, 20 insertions, 5 deletions
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()) |