techage_modpack/techage/iron_age/lighter.lua

90 lines
2.1 KiB
Lua
Raw Permalink Normal View History

2020-05-31 23:31:18 +03:00
--[[
TechAge
=======
Copyright (C) 2019 Joachim Stolberg
2020-10-25 23:32:47 +03:00
AGPL v3
2020-05-31 23:31:18 +03:00
See LICENSE.txt for more information
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
Lighter for Coalburner and Charcoalpile
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
]]--
local S = techage.S
minetest.register_node("techage:lighter_burn", {
tiles = {"techage_lighter_burn.png"},
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
after_place_node = function(pos)
techage.start_pile(pos)
end,
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
on_timer = function(pos, elapsed)
return techage.keep_running_pile(pos)
end,
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
on_destruct = function(pos)
techage.stop_pile(pos)
end,
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
drop = "",
light_source = 10,
is_ground_content = false,
groups = {crumbly = 3, snappy = 3, oddly_breakable_by_hand = 1, not_in_creative_inventory=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("techage:coal_lighter_burn", {
tiles = {"techage_lighter_burn.png"},
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
after_place_node = function(pos)
local meta = minetest.get_meta(pos)
local playername = meta:get_string("playername")
techage.start_burner(pos, playername)
end,
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
on_timer = function(pos, elapsed)
return techage.keep_running_burner(pos)
end,
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
on_destruct = function(pos)
techage.stop_burner(pos)
end,
2022-01-04 21:43:30 +03:00
2020-05-31 23:31:18 +03:00
drop = "",
light_source = 10,
is_ground_content = false,
groups = {crumbly = 3, snappy = 3, oddly_breakable_by_hand = 1, not_in_creative_inventory=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("techage:lighter", {
description = S("TA1 Lighter"),
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,
2022-01-04 21:43:30 +03:00
groups = {crumbly = 3, snappy = 3, oddly_breakable_by_hand = 1, flammable = 2},
2020-05-31 23:31:18 +03:00
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
output = 'techage:lighter 2',
recipe = {
{'group:wood'},
{'farming:straw'},
{''},
}
})