Hey I really like this mod! I just thought of something to make it better:
A working chimney for the fireplace!
![Image](http://www.zimg.eu/i/2562539721)
It's got animated smoke, and the chimney is hollow. You can even fall down inside it, if you get yourself aligned perfectly.
![Image](http://www.zimg.eu/i/2596490195)
Here's the code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_abm(
{nodenames = {"firestone:chimney"},
neighbors = {"group:igniter"},
interval = 5.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
p_bottom = {x=pos.x, y=pos.y-1, z=pos.z}
n_bottom = minetest.env:get_node(p_bottom)
local chimney_top = false
local j = 1
local node_param = minetest.registered_nodes[n_bottom.name]
if node_param.groups.igniter then
while chimney_top == false do
upper_pos = {x=pos.x, y=pos.y+j, z=pos.z}
upper_node = minetest.env:get_node(upper_pos)
if upper_node.name == "firestone:chimney" then
j = j+1
elseif upper_node.name == "air" then
minetest.env:place_node(upper_pos,{name="firestone:smoke"})
chimney_top = true
elseif upper_node.name == "firestone:smoke" then
local old = minetest.env:get_meta(upper_pos)
old:set_int("age", 0)
chimney_top = true
elseif upper_node.name ~= "air" or upper_node.name ~= "firestone:chimney" or upper_node.name ~= "firestone:smoke" then
chimney_top = true
end
end
end
end,
})
minetest.register_abm(
{nodenames = {"firestone:smoke"},
interval = 5.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local old = minetest.env:get_meta(pos)
if old:get_int("age") == 1 then
minetest.env:remove_node(pos)
else
old:set_int("age", 1)
end
end
})
minetest.register_craft({
output = '"firestone:chimney" 4',
recipe = {
{'', 'default:stone', ''},
{'default:stone', '', 'default:stone'},
{'', 'default:stone', ''},
}
})
minetest.register_node("firestone:chimney", {
description = "WIP",
drawtype = "nodebox",
node_box = {type = "fixed",
fixed = {
{0.3125, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.3125, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.3125},
},
},
selection_box = {
type = "regular",
},
tiles ={"chimney.png", "chimney.png", "chimney_side.png"},
paramtype = 'light',
sunlight_propagates = true,
walkable = true,
groups = {cracky=2},
})
minetest.register_node("firestone:smoke", {
description = "smoke",
drawtype = "plantlike",
tiles ={{
name="smoke_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0},
}},
sunlight_propagates = true,
groups = {not_in_creative_inventory=1},
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
light_source = 10,
on_place_node = function(pos)
local old = minetest.env:get_meta(pos)
old:set_int("age", 0)
end
})
And here's the textures:
![Image](http://www.zimg.eu/i/681375905)
![Image](http://www.zimg.eu/i/3861053567)
![Image](http://www.zimg.eu/i/3505430029)
The chimney textures are just cobblestone edited.
The smoke animation was made from tiles from Nemo8's old nPartical mod, dunno if you can use those long term because I can't find a license for it.
Anyway, tell me what you think.