2022-05-20 14:33:18 +03:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
|
|
|
|
|
|
|
mcl_bells = {}
|
|
|
|
|
|
|
|
local has_mcl_wip = minetest.get_modpath("mcl_wip")
|
|
|
|
|
2022-05-20 14:44:17 +03:00
|
|
|
function mcl_bells.ring_once(pos)
|
2022-05-22 02:53:10 +03:00
|
|
|
minetest.sound_play( "mcl_bells_bell_stroke", { pos = pos, gain = 1.5, max_hear_distance = 150,})
|
|
|
|
local vv=minetest.get_objects_inside_radius(pos,150)
|
|
|
|
for _,o in pairs(vv) do
|
|
|
|
if o.type == "npc" then
|
2022-11-10 02:52:45 +03:00
|
|
|
o:get_luaentity():gopath(pos,function() end)
|
2022-05-22 02:53:10 +03:00
|
|
|
end
|
|
|
|
end
|
2022-05-20 14:44:17 +03:00
|
|
|
end
|
|
|
|
|
2022-05-20 14:33:18 +03:00
|
|
|
minetest.register_node("mcl_bells:bell", {
|
|
|
|
description = S("Bell"),
|
2022-05-20 22:25:06 +03:00
|
|
|
inventory_image = "mcl_bells_bell.png",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
2022-05-20 14:33:18 +03:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2022-05-20 22:25:06 +03:00
|
|
|
{ -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",
|
2022-05-20 14:33:18 +03:00
|
|
|
},
|
2022-05-20 14:36:41 +03:00
|
|
|
is_ground_content = false,
|
2023-07-02 17:54:56 +03:00
|
|
|
groups = {pickaxey=2, deco_block=1, dig_by_piston=1 },
|
2022-05-20 14:36:41 +03:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2022-06-12 12:30:39 +03:00
|
|
|
_mcl_blast_resistance = 5,
|
2022-05-20 14:36:41 +03:00
|
|
|
_mcl_hardness = 5,
|
2022-05-20 14:44:17 +03:00
|
|
|
on_rightclick = mcl_bells.ring_once,
|
2022-05-25 20:37:36 +03:00
|
|
|
use_texture_alpha = "clip",
|
2022-06-07 04:29:06 +03:00
|
|
|
mesecons = {effector = {
|
|
|
|
action_on = mcl_bells.ring_once,
|
|
|
|
rules = mesecon.rules.flat,
|
|
|
|
}},
|
2022-05-20 14:33:18 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
if has_mcl_wip then
|
|
|
|
mcl_wip.register_wip_item("mcl_bells:bell")
|
|
|
|
end
|