{"action":"created","issue":{"url":"https://api.github.com/repos/minetest/minetest_game/issues/676","labels_url":"https://api.github.com/repos/minetest/minetest_game/issues/676/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest_game/issues/676/comments","events_url":"https://api.github.com/repos/minetest/minetest_game/issues/676/events","html_url":"https://github.com/minetest/minetest_game/issues/676","id":106934806,"number":676,"title":"How to implement permanent fire","user":{"login":"paramat","id":3686677,"avatar_url":"https://avatars.githubusercontent.com/u/3686677?v=3","gravatar_id":"","url":"https://api.github.com/users/paramat","html_url":"https://github.com/paramat","followers_url":"https://api.github.com/users/paramat/followers","following_url":"https://api.github.com/users/paramat/following{/other_user}","gists_url":"https://api.github.com/users/paramat/gists{/gist_id}","starred_url":"https://api.github.com/users/paramat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramat/subscriptions","organizations_url":"https://api.github.com/users/paramat/orgs","repos_url":"https://api.github.com/users/paramat/repos","events_url":"https://api.github.com/users/paramat/events{/privacy}","received_events_url":"https://api.github.com/users/paramat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/minetest/minetest_game/labels/feature%20request","name":"feature request","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-17T08:28:15Z","updated_at":"2015-09-22T09:00:47Z","closed_at":null,"body":"Following discussion here #191 i would like this feature.\r\nI think it's best as a separate node so it doesn't get scanned by the fire ABMs. We already have permanent torches made from coal, so perhaps permanent fire could be allowed on a coal block for a large and impressive form of lighting? (and for cozy campfires).\r\nIf so, how to light a coal block? how about 'using' a torch on it?"},"comment":{"url":"https://api.github.com/repos/minetest/minetest_game/issues/comments/142218949","html_url":"https://github.com/minetest/minetest_game/issues/676#issuecomment-142218949","issue_url":"https://api.github.com/repos/minetest/minetest_game/issues/676","id":142218949,"user":{"login":"tenplus1","id":8145060,"avatar_url":"https://avatars.githubusercontent.com/u/8145060?v=3","gravatar_id":"","url":"https://api.github.com/users/tenplus1","html_url":"https://github.com/tenplus1","followers_url":"https://api.github.com/users/tenplus1/followers","following_url":"https://api.github.com/users/tenplus1/following{/other_user}","gists_url":"https://api.github.com/users/tenplus1/gists{/gist_id}","starred_url":"https://api.github.com/users/tenplus1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenplus1/subscriptions","organizations_url":"https://api.github.com/users/tenplus1/orgs","repos_url":"https://api.github.com/users/tenplus1/repos","events_url":"https://api.github.com/users/tenplus1/events{/privacy}","received_events_url":"https://api.github.com/users/tenplus1/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T09:00:47Z","updated_at":"2015-09-22T09:00:47Z","body":"We get around this by adding a fireplace node to the game which you can punch with a torch to produce a safe flame:\r\n\r\n```\r\nminetest.register_node(\"xanadu:fireplace\", {\r\n\tdescription = \"Fireplace\",\r\n\ttiles = {\"default_cobble.png\", \"default_stone.png\", \"default_stone.png\"},\r\n\tgroups = {cracky = 3, stone = 1},\r\n\r\n\t-- add fire on top when punched with torch\r\n\ton_punch = function(pos, node, puncher, pointed_thing)\r\n\t\tif puncher:get_wielded_item():get_name() == \"default:torch\" then\r\n\t\t\tlocal npos = { x = pos.x, y = pos.y + 1, z = pos.z}\r\n\t\t\tif (minetest.get_node(npos).name == \"air\") then\r\n\t\t\t\tminetest.set_node(npos, {name = \"xanadu:safe_fire\"})\r\n--\t\t\t\tminetest.sound_play(\"fire_small\", {pos=npos})\r\n\t\t\tend\r\n\t\tend\r\n\tend,\r\n\r\n\t-- remove fire with fireplace\r\n\tafter_destruct = function(pos, oldnode)\r\n\t\tlocal npos = { x = pos.x, y = pos.y + 1, z = pos.z}\r\n\t\tif (minetest.get_node(npos).name == \"xanadu:safe_fire\") then\r\n\t\t\tminetest.set_node(npos, {name = \"air\"})\r\n\t\tend\r\n\tend,\r\n})\r\n\r\nminetest.register_node(\"xanadu:safe_fire\", {\r\n\tdescription = \"Safe Fire\",\r\n\tdrawtype = \"plantlike\",\r\n\ttiles = {{\r\n\t\tname=\"fire_basic_flame_animated.png\",\r\n\t\tanimation={type=\"vertical_frames\", aspect_w=16, aspect_h=16, length=1},\r\n\t}},\r\n\tinventory_image = \"fire_basic_flame.png\",\r\n\tlight_source = 14,\r\n\tgroups = {dig_immediate=3, hot=2, not_in_creative_inventory=1},\r\n\tdrop = \"\",\r\n\twalkable = false,\r\n\tbuildable_to = true,\r\n\tdamage_per_second = 2,\r\n})\r\n\r\nminetest.register_craft({\r\n\toutput = \"xanadu:fireplace\",\r\n\trecipe = {\r\n\t\t{\"default:cobble\", \"default:torch\", \"default:cobble\"},\r\n\t\t{\"default:stone\", \"default:glass\", \"default:stone\"},\r\n\t\t{\"default:stone\", \"default:stone\", \"default:stone\"},\r\n\t}\r\n})"}}