I'm working on a new update on my new mod Oxygenerators
the update consist on making the oxygenerator need fuel to activate
so it works like a furnace when there is fuel it burns it and swaps the node from oxygenerator:oxygenerator_small to oxygenerator:oxygenerator_small_active
The problem is that it's not swapping the node or burning the fuel when there is fuel.
no errors on debug.txt and here is where I think the problem is....
Code: Select all
local function oxygenerator_node_timer(pos)
--
-- Update formspec, infotext and node
-- oxygenerate_fuel
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = ItemStack("oxygenerator:air_tank 1")
local fuel = inv:contains_item("fuel", stack) -- nil if not true
local node = minetest.get_node(pos)
if fuel then
minetest.get_node_timer(pos):start(1)
if timer:is_started() == false then
timer:start(oxygenerator.consume_rate)
minetest.get_node_timer(pos):start(1)
inv:remove_item("fuel", stack)
minetest.swap_node(pos, {name="oxygenerator:oxygenerator_small_active"})
end
else
minetest.swap_node(pos, {name="oxygenerator:oxygenerator_small", param2=node.param2})
meta:set_string("infotext", "Insert Air tanks as fuel12.")
--
--
-- stop timer on the inactive oxygenerator
timer:stop()
end
end
Download: https://github.com/ManElevation/oxygeneratorerror