mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
1ba12aec60
thx erlehmann for the nodebox <3
40 lines
1019 B
Lua
40 lines
1019 B
Lua
local S = minetest.get_translator(minetest.get_current_modname())
|
|
|
|
mcl_bells = {}
|
|
|
|
local has_mcl_wip = minetest.get_modpath("mcl_wip")
|
|
|
|
function mcl_bells.ring_once(pos)
|
|
minetest.sound_play( "mcl_bells_bell_stroke", { pos = pos, gain = 1.5, max_hear_distance = 300,});
|
|
end
|
|
|
|
minetest.register_node("mcl_bells:bell", {
|
|
description = S("Bell"),
|
|
inventory_image = "mcl_bells_bell.png",
|
|
drawtype = "nodebox",
|
|
node_box = {
|
|
type = "fixed",
|
|
fixed = {
|
|
{ -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
|
|
{ -6/16, -6/16, -6/16, 6/16, 6/16, 6/16 },
|
|
{ -2/16, 6/16, -2/16, 2/16, 8/16, 2/16 },
|
|
}
|
|
},
|
|
--tiles = { "blank.png" },
|
|
tiles = {
|
|
"mcl_bells_bell_top.png",
|
|
"mcl_bells_bell_bottom.png",
|
|
"mcl_bells_bell_side.png",
|
|
},
|
|
is_ground_content = false,
|
|
groups = {pickaxey=2, deco_block=1 },
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
|
_mcl_blast_resistance = 6,
|
|
_mcl_hardness = 5,
|
|
on_rightclick = mcl_bells.ring_once,
|
|
})
|
|
|
|
if has_mcl_wip then
|
|
mcl_wip.register_wip_item("mcl_bells:bell")
|
|
end
|