3 -- support for MT game translation.
4 local S = default.get_translator
6 local function on_flood(pos, oldnode, newnode)
7 minetest.add_item(pos, ItemStack("default:torch 1"))
8 -- Play flame-extinguish sound if liquid is not an 'igniter'
9 local nodedef = minetest.registered_items[newnode.name]
10 if not (nodedef and nodedef.groups and
11 nodedef.groups.igniter and nodedef.groups.igniter > 0) then
14 {pos = pos, max_hear_distance = 16, gain = 0.1},
18 -- Remove the torch node
22 minetest.register_node("default:torch", {
23 description = S("Torch"),
25 mesh = "torch_floor.obj",
26 inventory_image = "default_torch_on_floor.png",
27 wield_image = "default_torch_on_floor.png",
29 name = "default_torch_on_floor_animated.png",
30 animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
33 paramtype2 = "wallmounted",
34 sunlight_propagates = true,
36 liquids_pointable = false,
38 groups = {choppy=2, dig_immediate=3, flammable=1, attached_node=1, torch=1},
39 drop = "default:torch",
42 wall_bottom = {-1/8, -1/2, -1/8, 1/8, 2/16, 1/8},
44 sounds = default.node_sound_wood_defaults(),
45 on_place = function(itemstack, placer, pointed_thing)
46 local under = pointed_thing.under
47 local node = minetest.get_node(under)
48 local def = minetest.registered_nodes[node.name]
49 if def and def.on_rightclick and
50 not (placer and placer:is_player() and
51 placer:get_player_control().sneak) then
52 return def.on_rightclick(under, node, placer, itemstack,
53 pointed_thing) or itemstack
56 local above = pointed_thing.above
57 local wdir = minetest.dir_to_wallmounted(vector.subtract(under, above))
58 local fakestack = itemstack
60 fakestack:set_name("default:torch_ceiling")
62 fakestack:set_name("default:torch")
64 fakestack:set_name("default:torch_wall")
67 itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
68 itemstack:set_name("default:torch")
77 minetest.register_node("default:torch_wall", {
79 mesh = "torch_wall.obj",
81 name = "default_torch_on_floor_animated.png",
82 animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
85 paramtype2 = "wallmounted",
86 sunlight_propagates = true,
89 groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1},
90 drop = "default:torch",
93 wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8},
95 sounds = default.node_sound_wood_defaults(),
101 minetest.register_node("default:torch_ceiling", {
103 mesh = "torch_ceiling.obj",
105 name = "default_torch_on_floor_animated.png",
106 animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3}
109 paramtype2 = "wallmounted",
110 sunlight_propagates = true,
113 groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1},
114 drop = "default:torch",
116 type = "wallmounted",
117 wall_top = {-1/8, -1/16, -5/16, 1/8, 1/2, 1/8},
119 sounds = default.node_sound_wood_defaults(),
125 minetest.register_lbm({
126 name = "default:3dtorch",
127 nodenames = {"default:torch", "torches:floor", "torches:wall"},
128 action = function(pos, node)
129 if node.param2 == 0 then
130 minetest.set_node(pos, {name = "default:torch_ceiling",
131 param2 = node.param2})
132 elseif node.param2 == 1 then
133 minetest.set_node(pos, {name = "default:torch",
134 param2 = node.param2})
136 minetest.set_node(pos, {name = "default:torch_wall",
137 param2 = node.param2})
142 minetest.register_craft({
143 output = "default:torch 4",
145 {"default:coal_lump"},
150 minetest.register_craft({
152 recipe = "default:torch",