--- Thanks to sofar for helping with that code.
+--[[ Thanks to sofar for helping with that code.
+Pressure plates work better with this setting in minetest.conf (requires 0.4.14):
+ nodetimer_interval = 0.1
+]]
+
local plate = {}
screwdriver = screwdriver or {}
end
function plate.register(material, desc, def)
- local sound, groups = def.sounds, def.groups
xdecor.register("pressure_"..material.."_off", {
description = desc.." Pressure Plate",
tiles = {"xdecor_pressure_"..material..".png"},
drawtype = "nodebox",
node_box = xdecor.pixelbox(16, {{1, 0, 1, 14, 1, 14}}),
- groups = groups,
- sounds = sound,
+ groups = def.groups,
+ sounds = def.sounds,
sunlight_propagates = true,
on_rotate = screwdriver.rotate_simple,
on_construct = plate.construct,
tiles = {"xdecor_pressure_"..material..".png"},
drawtype = "nodebox",
node_box = xdecor.pixelbox(16, {{1, 0, 1, 14, 0.4, 14}}),
- groups = groups,
- sounds = sound,
+ groups = def.groups,
+ sounds = def.sounds,
drop = "xdecor:pressure_"..material.."_off",
sunlight_propagates = true,
on_rotate = screwdriver.rotate_simple
plate.register("wood", "Wooden", {
sounds = default.node_sound_wood_defaults(),
- groups = {choppy=3, flammable=2}
+ groups = {choppy=3, oddly_breakable_by_hand=2, flammable=2}
})
plate.register("stone", "Stone", {
sounds = default.node_sound_stone_defaults(),
- groups = {cracky=3}
+ groups = {cracky=3, oddly_breakable_by_hand=2}
})
xdecor.register("lever_off", {