bring back the original plantlike bell as an option
parent
017c8b9e8b
commit
972d761e28
180
init.lua
180
init.lua
|
@ -160,34 +160,11 @@ restore_bell_data()
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
--- Node definitions
|
--- Node definitions
|
||||||
|
|
||||||
local bell_def = {
|
local bell_base = {
|
||||||
description = S("Bell"),
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
description = S("Bell"),
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
|
|
||||||
drawtype = "mesh",
|
|
||||||
mesh = "bell_bell.obj",
|
|
||||||
tiles = {
|
|
||||||
{ name = "bell_hull.png", backface_culling = true }, --
|
|
||||||
{ name = "bell_hull.png", backface_culling = true }, --
|
|
||||||
{ name = "bell_hull.png", backface_culling = true }, --
|
|
||||||
{ name = "default_wood.png", backface_culling = true }, --
|
|
||||||
},
|
|
||||||
collision_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
|
|
||||||
|
|
||||||
on_punch = function (pos,node,puncher)
|
on_punch = function (pos,node,puncher)
|
||||||
ring_big_bell(pos)
|
ring_big_bell(pos)
|
||||||
end,
|
end,
|
||||||
|
@ -202,62 +179,36 @@ local bell_def = {
|
||||||
local found = 0
|
local found = 0
|
||||||
-- actually remove the bell from the list
|
-- actually remove the bell from the list
|
||||||
for i,v in ipairs( bell_positions ) do
|
for i,v in ipairs( bell_positions ) do
|
||||||
if( v ~= nil and v.x == pos.x and v.y == pos.y and v.z == pos.z ) then
|
if(v ~= nil and vector.equals(v, pos)) then
|
||||||
found = i
|
table.remove( bell_positions, i)
|
||||||
|
save_bell_positions()
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- actually remove the bell
|
|
||||||
if( found > 0 ) then
|
|
||||||
table.remove( bell_positions, found )
|
|
||||||
save_bell_positions()
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
groups = {cracky=2},
|
groups = {cracky=2},
|
||||||
}
|
}
|
||||||
|
|
||||||
if minetest.get_modpath("mesecons") then
|
if minetest.get_modpath("mesecons") then
|
||||||
bell_def.mesecons = {
|
bell_base.mesecons = {
|
||||||
effector = {
|
effector = {
|
||||||
action_on = ring_big_bell,
|
action_on = ring_big_bell,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("bell:bell", bell_def)
|
|
||||||
|
|
||||||
|
|
||||||
local ring_small_bell = function(pos)
|
local ring_small_bell = function(pos)
|
||||||
minetest.sound_play( "bell_small",
|
minetest.sound_play( "bell_small",
|
||||||
{ pos = pos, gain = 1.5, max_hear_distance = 60,})
|
{ pos = pos, gain = 1.5, max_hear_distance = 60,})
|
||||||
end
|
end
|
||||||
|
|
||||||
local small_bell_def = {
|
|
||||||
|
local small_bell_base = {
|
||||||
description = S("Small bell"),
|
description = S("Small bell"),
|
||||||
|
paramtype = "light",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
|
|
||||||
drawtype = "mesh",
|
|
||||||
mesh = "bell_small_bell.obj",
|
|
||||||
tiles = {
|
|
||||||
{ name = "bell_hull.png", backface_culling = true }, --
|
|
||||||
{ name = "bell_hull.png", backface_culling = true }, --
|
|
||||||
{ name = "bell_hull.png", backface_culling = true }, --
|
|
||||||
{ name = "default_wood.png", backface_culling = true }, --
|
|
||||||
},
|
|
||||||
collision_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.375, -0.25, -0.375, 0.375, 0.5, 0.375},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.375, -0.25, -0.375, 0.375, 0.5, 0.375},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
|
|
||||||
on_punch = function (pos,node,puncher)
|
on_punch = function (pos,node,puncher)
|
||||||
ring_small_bell(pos)
|
ring_small_bell(pos)
|
||||||
end,
|
end,
|
||||||
|
@ -265,14 +216,105 @@ local small_bell_def = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if minetest.get_modpath("mesecons") then
|
if minetest.get_modpath("mesecons") then
|
||||||
small_bell_def.mesecons = {
|
small_bell_base.mesecons = {
|
||||||
effector = {
|
effector = {
|
||||||
action_on = ring_small_bell,
|
action_on = ring_small_bell,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("bell:bell_small", small_bell_def)
|
----------------------------------------------------
|
||||||
|
|
||||||
|
if minetest.settings:get_bool("bell_enable_model", true) then
|
||||||
|
----------------
|
||||||
|
-- Model-type bell
|
||||||
|
local bell_def = {
|
||||||
|
drawtype = "mesh",
|
||||||
|
mesh = "bell_bell.obj",
|
||||||
|
tiles = {
|
||||||
|
{ name = "bell_hull.png", backface_culling = true }, --
|
||||||
|
{ name = "bell_hull.png", backface_culling = true }, --
|
||||||
|
{ name = "bell_hull.png", backface_culling = true }, --
|
||||||
|
{ name = "default_wood.png", backface_culling = true }, --
|
||||||
|
},
|
||||||
|
collision_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v in pairs(bell_base) do
|
||||||
|
bell_def[k] = v
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("bell:bell", bell_def)
|
||||||
|
|
||||||
|
local small_bell_def =
|
||||||
|
{ drawtype = "mesh",
|
||||||
|
mesh = "bell_small_bell.obj",
|
||||||
|
tiles = {
|
||||||
|
{ name = "bell_hull.png", backface_culling = true }, --
|
||||||
|
{ name = "bell_hull.png", backface_culling = true }, --
|
||||||
|
{ name = "bell_hull.png", backface_culling = true }, --
|
||||||
|
{ name = "default_wood.png", backface_culling = true }, --
|
||||||
|
},
|
||||||
|
collision_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.375, -0.25, -0.375, 0.375, 0.5, 0.375},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.375, -0.25, -0.375, 0.375, 0.5, 0.375},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
paramtype2 = "facedir",
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v in pairs(small_bell_base) do
|
||||||
|
small_bell_def[k] = v
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("bell:bell_small", small_bell_def)
|
||||||
|
|
||||||
|
else
|
||||||
|
--------------------
|
||||||
|
-- Plantlike-type bell
|
||||||
|
local bell_def = {
|
||||||
|
tiles = {"bell_bell.png"},
|
||||||
|
inventory_image = 'bell_bell.png',
|
||||||
|
wield_image = 'bell_bell.png',
|
||||||
|
drawtype = "plantlike",
|
||||||
|
}
|
||||||
|
for k, v in pairs(bell_base) do
|
||||||
|
bell_def[k] = v
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("bell:bell", bell_def)
|
||||||
|
|
||||||
|
local small_bell_def = {
|
||||||
|
tiles = {"bell_bell.png"},
|
||||||
|
inventory_image = 'bell_bell.png',
|
||||||
|
wield_image = 'bell_bell.png',
|
||||||
|
drawtype = "plantlike",
|
||||||
|
}
|
||||||
|
for k, v in pairs(small_bell_base) do
|
||||||
|
small_bell_def[k] = v
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("bell:bell_small", small_bell_def)
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
--- Recipes
|
--- Recipes
|
||||||
|
@ -287,11 +329,11 @@ if minetest.get_modpath("default") then
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "bell:bell",
|
output = "bell:bell",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:goldblock", "default:goldblock", "default:goldblock"},
|
{"default:goldblock", "default:goldblock", "default:goldblock"},
|
||||||
{"default:goldblock", "default:goldblock", "default:goldblock"},
|
{"default:goldblock", "default:goldblock", "default:goldblock"},
|
||||||
{"default:goldblock", "", "default:goldblock"},
|
{"default:goldblock", "", "default:goldblock"},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,4 +12,6 @@ bell_tolls_at_noon (Bell tolls at noon) int 0
|
||||||
bell_tolls_at_dusk (Bell tolls at dusk) int 0
|
bell_tolls_at_dusk (Bell tolls at dusk) int 0
|
||||||
|
|
||||||
#Bell tolls the number of hours (per the real-world server timezone) on the hour
|
#Bell tolls the number of hours (per the real-world server timezone) on the hour
|
||||||
bell_tolls_at_server_hours (Bell tolls at server hours) bool true
|
bell_tolls_at_server_hours (Bell tolls at server hours) bool true
|
||||||
|
|
||||||
|
bell_enable_model (Use model-based bell nodes) bool true
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 823 B |
|
@ -1 +1,3 @@
|
||||||
bell_hull.png was created by FaceDeer and is released under the CC-0 public domain license
|
bell_hull.png was created by FaceDeer and is released under the CC-0 public domain license
|
||||||
|
|
||||||
|
bell_bell.png was created by Sokomine and is released under the GPLv3 license
|
Loading…
Reference in New Issue