2019-03-19 00:40:17 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
|
|
|
Copyright (C) 2019 Joachim Stolberg
|
|
|
|
|
|
|
|
LGPLv2.1+
|
|
|
|
See LICENSE.txt for more information
|
|
|
|
|
|
|
|
Lighter for Coalburner and Charcoalpile
|
|
|
|
|
|
|
|
]]--
|
|
|
|
|
2019-07-02 22:33:12 +03:00
|
|
|
local S = techage.S
|
2019-03-19 00:40:17 +03:00
|
|
|
|
|
|
|
minetest.register_node("techage:lighter_burn", {
|
|
|
|
tiles = {"techage_lighter_burn.png"},
|
|
|
|
|
|
|
|
after_place_node = function(pos)
|
|
|
|
techage.start_pile(pos)
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_timer = function(pos, elapsed)
|
|
|
|
return techage.keep_running_pile(pos)
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_destruct = function(pos)
|
|
|
|
techage.stop_pile(pos)
|
|
|
|
end,
|
|
|
|
|
|
|
|
drop = "",
|
|
|
|
light_source = 10,
|
|
|
|
is_ground_content = false,
|
2019-05-11 02:21:03 +03:00
|
|
|
groups = {crumbly = 1, not_in_creative_inventory=1},
|
2019-03-19 00:40:17 +03:00
|
|
|
sounds = default.node_sound_dirt_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:coal_lighter_burn", {
|
|
|
|
tiles = {"techage_lighter_burn.png"},
|
|
|
|
|
|
|
|
after_place_node = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local playername = meta:get_string("playername")
|
|
|
|
techage.start_burner(pos, playername)
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_timer = function(pos, elapsed)
|
|
|
|
return techage.keep_running_burner(pos)
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_destruct = function(pos)
|
|
|
|
techage.stop_burner(pos)
|
|
|
|
end,
|
|
|
|
|
|
|
|
drop = "",
|
|
|
|
light_source = 10,
|
|
|
|
is_ground_content = false,
|
2019-05-11 02:21:03 +03:00
|
|
|
groups = {crumbly = 1, not_in_creative_inventory=1},
|
2019-03-19 00:40:17 +03:00
|
|
|
sounds = default.node_sound_dirt_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:lighter", {
|
2019-05-01 00:58:42 +03:00
|
|
|
description = S("TA1 Lighter"),
|
2019-03-19 00:40:17 +03:00
|
|
|
tiles = {"techage_lighter.png"},
|
|
|
|
on_ignite = function(pos, igniter)
|
|
|
|
if minetest.find_node_near(pos, 1, "techage:charcoal") then
|
|
|
|
minetest.after(1, techage.ironage_swap_node, pos, "techage:coal_lighter_burn")
|
|
|
|
else
|
|
|
|
minetest.after(1, techage.ironage_swap_node, pos, "techage:lighter_burn")
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
after_place_node = function(pos, placer)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("playername", placer:get_player_name())
|
|
|
|
end,
|
|
|
|
is_ground_content = false,
|
2019-05-11 02:21:03 +03:00
|
|
|
groups = {crumbly = 1, flammable = 2},
|
2019-03-19 00:40:17 +03:00
|
|
|
sounds = default.node_sound_dirt_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'techage:lighter 2',
|
|
|
|
recipe = {
|
|
|
|
{'group:wood'},
|
|
|
|
{'farming:straw'},
|
|
|
|
{''},
|
|
|
|
}
|
|
|
|
})
|
2019-05-01 00:58:42 +03:00
|
|
|
|
2019-07-02 22:33:12 +03:00
|
|
|
techage.register_entry_page("ta1", "lighter",
|
|
|
|
S("TA1 Lighter"),
|
|
|
|
S("lighter to ignite the Coal Burner and the Coal Pile."), "techage:lighter")
|
2019-05-01 00:58:42 +03:00
|
|
|
|