diff options
Diffstat (limited to 'fake_fire')
-rw-r--r-- | fake_fire/depends.txt | 1 | ||||
-rw-r--r-- | fake_fire/init.lua | 52 |
2 files changed, 30 insertions, 23 deletions
diff --git a/fake_fire/depends.txt b/fake_fire/depends.txt index 562cf63..f91fb9f 100644 --- a/fake_fire/depends.txt +++ b/fake_fire/depends.txt @@ -1 +1,2 @@ default
+homedecor
diff --git a/fake_fire/init.lua b/fake_fire/init.lua index 92d04f9..ffedce7 100644 --- a/fake_fire/init.lua +++ b/fake_fire/init.lua @@ -1,3 +1,6 @@ + +local S = homedecor_i18n.gettext + screwdriver = screwdriver or {} local function start_smoke(pos, node, clicker, chimney) @@ -8,8 +11,8 @@ local function start_smoke(pos, node, clicker, chimney) if id ~= 0 then if s_handle then - minetest.after(0, function(s_handle) - minetest.sound_stop(s_handle) + minetest.after(0, function(handle) + minetest.sound_stop(handle) end, s_handle) end minetest.delete_particlespawner(id) @@ -30,19 +33,18 @@ local function start_smoke(pos, node, clicker, chimney) texture = "smoke_particle.png", }) if chimney == 1 then - s_handle = nil this_spawner_meta:set_int("smoky", id) this_spawner_meta:set_int("sound", nil) else - s_handle = minetest.sound_play("fire_small", { - pos = pos, - max_hear_distance = 5, - loop = true - }) - this_spawner_meta:set_int("smoky", id) - this_spawner_meta:set_int("sound", s_handle) + s_handle = minetest.sound_play("fire_small", { + pos = pos, + max_hear_distance = 5, + loop = true + }) + this_spawner_meta:set_int("smoky", id) + this_spawner_meta:set_int("sound", s_handle) end - return end + end end local function stop_smoke(pos) @@ -55,8 +57,8 @@ local function stop_smoke(pos) end if s_handle then - minetest.after(0, function(s_handle) - minetest.sound_stop(s_handle) + minetest.after(0, function(handle) + minetest.sound_stop(handle) end, s_handle) end @@ -65,12 +67,16 @@ local function stop_smoke(pos) end -- FLAME TYPES -local flame_types = {"fake", "ice"} +local flame_types = { + { "fake", S("Fake fire") }, + { "ice", S("Ice fire") }, +} for _, f in ipairs(flame_types) do - minetest.register_node("fake_fire:"..f.."_fire", { - inventory_image = f.."_fire_inv.png", - description = f.." fire", + local name, desc = unpack(f) + minetest.register_node("fake_fire:"..name.."_fire", { + inventory_image = name.."_fire_inv.png", + description = desc, drawtype = "plantlike", paramtype = "light", paramtype2 = "facedir", @@ -81,7 +87,7 @@ for _, f in ipairs(flame_types) do light_source = 14, waving = 1, tiles = { - {name=f.."_fire_animated.png", animation={type="vertical_frames", + {name=name.."_fire_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}}, }, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) @@ -100,7 +106,7 @@ end minetest.register_node("fake_fire:fancy_fire", { inventory_image = "fancy_fire_inv.png", - description = "Fancy Fire", + description = S("Fancy Fire"), drawtype = "mesh", mesh = "fancy_fire.obj", paramtype = "light", @@ -112,7 +118,7 @@ minetest.register_node("fake_fire:fancy_fire", { damage_per_second = 4, on_rotate = screwdriver.rotate_simple, tiles = { - {name="fake_fire_animated.png", + {name="fake_fire_animated.png", animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}}, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) start_smoke(pos, node, clicker) @@ -137,7 +143,7 @@ minetest.register_node("fake_fire:fancy_fire", { -- EMBERS minetest.register_node("fake_fire:embers", { - description = "Glowing Embers", + description = S("Glowing Embers"), tiles = { {name="embers_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}}, @@ -172,7 +178,7 @@ for _, m in ipairs(materials) do stop_smoke(pos) end }) - + minetest.register_craft({ type = "shapeless", output = 'fake_fire:chimney_top_'..m, @@ -182,7 +188,7 @@ end -- FLINT and STEEL minetest.register_tool("fake_fire:flint_and_steel", { - description = "Flint and steel", + description = S("Flint and steel"), inventory_image = "flint_and_steel.png", liquids_pointable = false, stack_max = 1, |