Fix sounds of pressure plates, change groups

This commit is contained in:
Wuzzy 2018-01-28 21:14:54 +01:00
parent 6f1ff24474
commit 1b513d2111

View File

@ -42,8 +42,18 @@ end
-- tiles_on: textures of the pressure plate when active -- tiles_on: textures of the pressure plate when active
-- image: inventory and wield image of the pressure plate -- image: inventory and wield image of the pressure plate
-- recipe: crafting recipe 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, { mesecon.register_node(basename, {
drawtype = "nodebox", drawtype = "nodebox",
inventory_image = image_i, inventory_image = image_i,
@ -56,17 +66,18 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te
on_construct = function(pos) on_construct = function(pos)
minetest.get_node_timer(pos):start(mesecon.setting("pplate_interval", 0.1)) minetest.get_node_timer(pos):start(mesecon.setting("pplate_interval", 0.1))
end, end,
sounds = sounds,
},{ },{
mesecons = {receptor = { state = mesecon.state.off, rules = mesecon.rules.pplate }}, mesecons = {receptor = { state = mesecon.state.off, rules = mesecon.rules.pplate }},
node_box = pp_box_off, node_box = pp_box_off,
selection_box = pp_box_off, selection_box = pp_box_off,
groups = {snappy = 2, oddly_breakable_by_hand = 3}, groups = groups_off,
tiles = textures_off tiles = textures_off
},{ },{
mesecons = {receptor = { state = mesecon.state.on, rules = mesecon.rules.pplate }}, mesecons = {receptor = { state = mesecon.state.on, rules = mesecon.rules.pplate }},
node_box = pp_box_on, node_box = pp_box_on,
selection_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 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_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_wield.png",
"jeija_pressure_plate_wood_inv.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( mesecon.register_pressure_plate(
"mesecons_pressureplates:pressure_plate_stone", "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_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_wield.png",
"jeija_pressure_plate_stone_inv.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())