question why is it 0.5?
minetest.register_abm({
nodenames = {"firestone:firestone"},
interval = 2,
chance = 5,
action = function(pos)
local t = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(t)
if n.name == "firestone:flame_low" then
minetest.env:set_node(t, {name="firestone:flame"})
elseif n.name == "firestone:flame" then
minetest.env:set_node(t, {name="firestone:flame_low"})
-- lighting the firestone
elseif minetest.get_item_group(n.name, "igniter") == 2 then
minetest.env:set_node(t, {name="firestone:flame"})
end
end,
})
minetest.register_alias("firestone", "firestone:firestone")
local makes_fire = false -- When set ture the firestone makes fire itself. When false you need to lighten it.
minetest.register_craft({
output = '"firestone:firestone" 1',
recipe = {
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
{'default:coal_lump', 'default:torch', 'default:coal_lump'},
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
}
})
if makes_fire == true then
minetest.register_node("firestone:firestone", {
description = "Fire node",
tile_images = {"firestone_firestone_top.png^firestone_embers.png", "firestone_firestone_bottom.png", "firestone_firestone.png"},
groups = {igniter=2, crumbly=3},
damage_per_second = 4,
after_place_node = function(pos)
local t = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(t)
if n.name == "air" then
minetest.env:add_node(t, {name="firestone:flame"})
end
end,
after_dig_node = function(pos)
local t = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(t)
if n.name == "firestone:flame" or n.name == "firestone:flame_low" then
minetest.env:remove_node(t)
end
end,
})
else
minetest.register_node("firestone:firestone", {
description = "Fire node",
tile_images = {"firestone_firestone_top.png^firestone_embers.png", "firestone_firestone_bottom.png", "firestone_firestone.png"},
groups = {igniter=2, crumbly=3},
damage_per_second = 4,
after_dig_node = function(pos)
local t = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(t)
if n.name == "firestone:flame" or n.name == "firestone:flame_low" then
minetest.env:remove_node(t)
end
end,
})
end
minetest.register_node("firestone:flame", {
description = "Fire",
drawtype = "plantlike",
tiles = {{
name="fire_basic_flame_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
}},
inventory_image = "fire_basic_flame.png",
light_source = 14,
groups = {igniter=2, immortal, not_in_creative_inventory=1},
drop = '',
walkable = false,
damage_per_second = 4,
})
minetest.register_node("firestone:flame_low", {
description = "Fire",
drawtype = "plantlike",
tiles = {{
name="fire_basic_flame_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
}},
inventory_image = "fire_basic_flame.png",
light_source = 12,
groups = {igniter=2, immortal, not_in_creative_inventory=1},
drop = '',
walkable = false,
damage_per_second = 4,
})
minetest.register_abm({
nodenames = {"firestone:firestone"},
interval = 2,
chance = 5,
action = function(pos)
local t = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(t)
if n.name == "firestone:flame_low" then
minetest.env:set_node(t, {name="firestone:flame"})
elseif n.name == "firestone:flame" then
minetest.env:set_node(t, {name="firestone:flame_low"})
-- lighting the firestone
elseif minetest.get_item_group(n.name, "igniter") ~= 0 and makes_fire == false and minetest.registered_nodes[n.name].buildable_to == true then
minetest.env:set_node(t, {name="firestone:flame"})
end
end,
})
Bas080 wrote:There is however an issue with your and mine code. The fire abm sometimes removes the fire before the firestone abm turns basic_flame into firestone flame.. something to solve.
jojoa1997 wrote:scs
sss
jojoa1997 wrote:how about this s=stone c=coal
ccc
scs
sss
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
})
BZab wrote:Nice, but will cobble texture change on my texture pack's texture? :D
tiles ={"default_cobble.png"},
Casimir wrote: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
tiles ={"default_cobble.png"},
aximx51v wrote:Hey I really like this mod! I just thought of something to make it better:
A working chimney for the fireplace!
LazyJ wrote:How far will the fire jump?
Likwid H-Craft wrote:I made Fire Proof Wood, so no need Fire of wood:D
Likwid H-Craft wrote:So I should upload my, fire proof wood?
Bas080 wrote:Likwid H-Craft wrote:So I should upload my, fire proof wood?
What should be the craft to fireproof wood?
Users browsing this forum: No registered users and 10 guests