power distribution changed
This commit is contained in:
parent
7b79a6c942
commit
4ca1ff8f5a
@ -19,7 +19,7 @@ local function swap_node(pos, name)
|
||||
end
|
||||
|
||||
local function on_power(pos, mem)
|
||||
print("on_power")
|
||||
mydbg("dbg", "on_power")
|
||||
if mem.running then
|
||||
swap_node(pos, "techage:sink_on")
|
||||
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
||||
@ -28,7 +28,7 @@ local function on_power(pos, mem)
|
||||
end
|
||||
|
||||
local function on_nopower(pos, mem)
|
||||
print("on_nopower")
|
||||
mydbg("dbg", "on_nopower")
|
||||
swap_node(pos, "techage:sink")
|
||||
M(pos):set_string("infotext", "nopower")
|
||||
end
|
||||
@ -44,14 +44,14 @@ local function on_rightclick(pos, node, clicker)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
if not mem.running and power.power_available(pos, mem, PWR_NEEDED) then
|
||||
mem.running = true
|
||||
print("turn on")
|
||||
mydbg("dbg", "turn on")
|
||||
--swap_node(pos, "techage:sink_on")
|
||||
power.consumer_start(pos, mem, CYCLE_TIME, PWR_NEEDED)
|
||||
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
||||
M(pos):set_string("infotext", "on")
|
||||
else
|
||||
mem.running = false
|
||||
print("turn off")
|
||||
mydbg("dbg", "turn off")
|
||||
swap_node(pos, "techage:sink")
|
||||
power.consumer_stop(pos, mem)
|
||||
minetest.get_node_timer(pos):stop()
|
||||
|
@ -29,24 +29,29 @@ local CRDN = function(node) return (minetest.registered_nodes[node.name] or {}).
|
||||
local power = techage.power
|
||||
|
||||
local function can_start(pos, mem, state)
|
||||
mydbg("con", "consumer can_start", state)
|
||||
return power.power_available(pos, mem, CRD(pos).power_consumption)
|
||||
end
|
||||
|
||||
local function start_node(pos, mem, state)
|
||||
local crd = CRD(pos)
|
||||
mydbg("con", "consumer start_node", state)
|
||||
power.consumer_start(pos, mem, crd.cycle_time, crd.power_consumption)
|
||||
end
|
||||
|
||||
local function stop_node(pos, mem, state)
|
||||
mydbg("con", "consumer stop_node", state)
|
||||
power.consumer_stop(pos, mem)
|
||||
end
|
||||
|
||||
local function on_power(pos, mem)
|
||||
mydbg("con", "consumer on_power")
|
||||
local crd = CRD(pos)
|
||||
crd.State:start(pos, mem)
|
||||
end
|
||||
|
||||
local function on_nopower(pos, mem)
|
||||
mydbg("con", "consumer on_nopower")
|
||||
local crd = CRD(pos)
|
||||
crd.State:nopower(pos, mem)
|
||||
end
|
||||
@ -55,7 +60,7 @@ local function node_timer(pos, elapsed)
|
||||
local crd = CRD(pos)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
local state = mem.techage_state
|
||||
print("consumer node_timer", techage.needs_power(mem))
|
||||
mydbg("con", "consumer node_timer", techage.needs_power(mem))
|
||||
if techage.power_alive(mem) then
|
||||
power.consumer_alive(pos, mem)
|
||||
end
|
||||
|
@ -96,7 +96,6 @@ function techage.firebox.on_receive_fields(pos, formname, fields, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
--print(dump(fields))
|
||||
if fields.update then
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
M(pos):set_string("formspec", techage.firebox.formspec(mem))
|
||||
|
@ -160,3 +160,13 @@ function techage.dropped_node(node, ndef)
|
||||
end
|
||||
return ndef.drop or node.name
|
||||
end
|
||||
|
||||
function mydbg(topic, text, ...)
|
||||
if techage.DebugTopics[topic] then
|
||||
local t = string.format("%.4f %4s: ", minetest.get_us_time() / 1000000.0, topic)
|
||||
if type(text) ~= "string" then
|
||||
text = dump(text)
|
||||
end
|
||||
print(t..text, unpack({...}))
|
||||
end
|
||||
end
|
@ -36,7 +36,7 @@ end
|
||||
|
||||
local function node_timer(pos, elapsed)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
--print("firebox burn_cycles = "..(mem.burn_cycles or 0))
|
||||
mydbg("dbg", "firebox burn_cycles = "..(mem.burn_cycles or 0))
|
||||
if mem.running then
|
||||
-- trigger generator and provide power ratio 0..1
|
||||
local ratio = techage.transfer(
|
||||
|
@ -192,7 +192,6 @@ techage.power.register_node({"techage:generator", "techage:generator_on"}, {
|
||||
-- for logical communication
|
||||
techage.register_node({"techage:generator", "techage:generator_on"}, {
|
||||
on_transfer = function(pos, in_dir, topic, payload)
|
||||
--print("generator", topic, payload)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
if topic == "power_level" then
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
|
@ -132,7 +132,6 @@ techage.power.register_node({"techage:turbine", "techage:turbine_on"}, {
|
||||
-- for logical communication
|
||||
techage.register_node({"techage:turbine", "techage:turbine_on"}, {
|
||||
on_transfer = function(pos, in_dir, topic, payload)
|
||||
--print("turbine", topic, payload)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
if topic == "trigger" then
|
||||
return transfer_generator(pos, topic, payload)
|
||||
|
@ -41,22 +41,26 @@ local function on_power(pos, mem)
|
||||
infotext(pos, "running")
|
||||
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
||||
end
|
||||
mydbg("dbg2", "booster on_power")
|
||||
mem.is_powered = true
|
||||
end
|
||||
|
||||
local function on_nopower(pos, mem)
|
||||
swap_node(pos, "techage:ta3_booster")
|
||||
infotext(pos, "no power")
|
||||
mydbg("dbg2", "booster on_nopower")
|
||||
mem.is_powered = false
|
||||
end
|
||||
|
||||
local function node_timer(pos, elapsed)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
if mem.running then
|
||||
if mem.is_powered then
|
||||
minetest.sound_play("techage_booster", {
|
||||
pos = pos,
|
||||
gain = 1,
|
||||
max_hear_distance = 7})
|
||||
end
|
||||
mem.still_powered = power.consumer_alive(pos, mem)
|
||||
power.consumer_alive(pos, mem)
|
||||
return mem.running
|
||||
end
|
||||
|
||||
@ -140,18 +144,23 @@ techage.register_node({"techage:ta3_booster", "techage:ta3_booster_on"}, {
|
||||
if M(pos):get_int("indir") == in_dir then
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
if topic == "power" then
|
||||
return mem.still_powered
|
||||
mydbg("dbg2", "booster", mem.is_powered)
|
||||
return mem.is_powered
|
||||
elseif topic == "start" and not mem.running then
|
||||
mydbg("dbg2", "booster try start", mem.pwr_master_pos, mem.pwr_power_provided_cnt)
|
||||
if power.power_available(pos, mem, 0) then
|
||||
mem.running = true
|
||||
mem.still_powered = treu
|
||||
mydbg("dbg2", "booster start")
|
||||
power.consumer_start(pos, mem, CYCLE_TIME, PWR_NEEDED)
|
||||
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
||||
else
|
||||
mydbg("dbg2", "booster no power")
|
||||
infotext(pos, "no power")
|
||||
end
|
||||
elseif topic == "stop" then
|
||||
mem.running = false
|
||||
mem.is_powered = false
|
||||
mydbg("dbg2", "booster stop")
|
||||
swap_node(pos, "techage:ta3_booster")
|
||||
power.consumer_stop(pos, mem)
|
||||
minetest.get_node_timer(pos):stop()
|
||||
|
@ -188,18 +188,26 @@ techage.register_node({"techage:furnace_firebox", "techage:furnace_firebox_on"},
|
||||
end,
|
||||
-- called from furnace_top
|
||||
on_transfer = function(pos, in_dir, topic, payload)
|
||||
--print("on_transfer", topic, payload)
|
||||
if topic == "fuel" then
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
return has_fuel(pos, mem) and booster_cmnd(pos, "power")
|
||||
if booster_cmnd(pos, "power") then
|
||||
-- fire keeps on even if the booster is off for some seconds
|
||||
mem.booster_cnt = 3
|
||||
end
|
||||
mydbg("dbg2", "firebox fuel", mem.booster_cnt)
|
||||
mem.booster_cnt = (mem.booster_cnt or 3) - 1
|
||||
return has_fuel(pos, mem) and mem.booster_cnt > 0
|
||||
elseif topic == "start" then
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
start_firebox(pos, mem)
|
||||
booster_cmnd(pos, "start")
|
||||
mem.booster_cnt = 4
|
||||
mydbg("dbg2", "firebox start", mem.booster_cnt)
|
||||
elseif topic == "stop" then
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
stop_firebox(pos, mem)
|
||||
booster_cmnd(pos, "stop")
|
||||
mydbg("dbg2", "firebox stop", mem.booster_cnt)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
@ -77,7 +77,6 @@ end
|
||||
local function cooking(pos, crd, mem, elapsed)
|
||||
if firebox_cmnd(pos, "fuel") then
|
||||
local state = smelting(pos, mem, elapsed)
|
||||
--print("cooking", techage.StateStrings[state])
|
||||
if state == techage.RUNNING then
|
||||
crd.State:keep_running(pos, mem, COUNTDOWN_TICKS)
|
||||
elseif state == techage.BLOCKED then
|
||||
@ -161,6 +160,7 @@ local function can_dig(pos, player)
|
||||
end
|
||||
|
||||
local function on_node_state_change(pos, old_state, new_state)
|
||||
mydbg("dbg2", "on_node_state_change", new_state)
|
||||
if new_state == techage.RUNNING then
|
||||
firebox_cmnd(pos, "start")
|
||||
else
|
||||
|
@ -49,8 +49,6 @@ minetest.after(1, function()
|
||||
if tbl then
|
||||
for _,recipe in ipairs(tbl) do
|
||||
if recipe and recipe.method == "cooking" then
|
||||
--print(dump(idef), dump(recipe))
|
||||
--print(key, recipe.width)
|
||||
techage.furnace.register_recipe({
|
||||
output = recipe.output,
|
||||
recipe = recipe.items,
|
||||
|
9
init.lua
9
init.lua
@ -19,6 +19,15 @@ else
|
||||
-- Load support for I18n.
|
||||
techage.S = minetest.get_translator("techage")
|
||||
|
||||
-- Debugging via "mydbg(topic, text)"
|
||||
techage.DebugTopics = {
|
||||
--con = true, -- consumer modell
|
||||
--pwr = true, -- power distribution
|
||||
sts = true, -- status plots
|
||||
--dbg = true,
|
||||
dbg2 = true,
|
||||
}
|
||||
|
||||
-- Basis features
|
||||
local MP = minetest.get_modpath("techage")
|
||||
dofile(MP.."/basis/lib.lua") -- helper functions
|
||||
|
@ -185,7 +185,6 @@ function techage.start_burner(pos, playername)
|
||||
end
|
||||
|
||||
function techage.keep_running_burner(pos)
|
||||
--print("keep_running_burner")
|
||||
local meta = minetest.get_meta(pos)
|
||||
local height = meta:get_int("height")
|
||||
remove_flame(pos, height)
|
||||
|
@ -206,7 +206,6 @@ local function get_heat(pos)
|
||||
pos.y = pos.y - 1
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
--print("get_heat1", minetest.get_item_group(node.name, "techage_flame"))
|
||||
if minetest.get_item_group(node.name, "techage_flame") == 0 then
|
||||
pos.y = pos.y + 1
|
||||
return 0
|
||||
@ -215,7 +214,6 @@ local function get_heat(pos)
|
||||
pos.y = pos.y - 1
|
||||
node = minetest.get_node(pos)
|
||||
pos.y = pos.y + 2
|
||||
--print("get_heat2", node.name, minetest.get_item_group(node.name, "techage_flame"))
|
||||
if minetest.get_item_group(node.name, "techage_flame") == 0 and
|
||||
node.name ~= "techage:charcoal_burn" then
|
||||
return 0
|
||||
|
@ -26,7 +26,6 @@ local function on_power(pos, mem)
|
||||
end
|
||||
|
||||
local function on_nopower(pos, mem)
|
||||
print(dump(mem))
|
||||
swap_node(pos, "off")
|
||||
end
|
||||
|
||||
|
@ -136,7 +136,7 @@ local function migrate(pos, mem)
|
||||
end
|
||||
|
||||
if not mem.pwr_needed and not mem.pwr_available and not mem.pwr_available2 then
|
||||
print(name)
|
||||
mydbg("dbg", name)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -165,8 +165,8 @@ local function accounting(pos, mem)
|
||||
mem.mst_supply2 = min(mem.mst_demand1 - mem.mst_supply1, mem.mst_available2)
|
||||
mem.mst_demand2 = min(mem.mst_supply1 - mem.mst_demand1, mem.mst_available1)
|
||||
mem.mst_reserve = (mem.mst_available1 + mem.mst_available2) - mem.mst_needed1
|
||||
print("needed = "..mem.mst_needed1.."/"..mem.mst_needed2..", available = "..mem.mst_available1.."/"..mem.mst_available2)
|
||||
print("supply = "..mem.mst_supply1.."/"..mem.mst_supply2..", demand = "..mem.mst_demand1.."/"..mem.mst_demand2..", reserve = "..mem.mst_reserve)
|
||||
mydbg("sts", "needed = "..mem.mst_needed1.."/"..mem.mst_needed2..", available = "..mem.mst_available1.."/"..mem.mst_available2)
|
||||
mydbg("sts", "supply = "..mem.mst_supply1.."/"..mem.mst_supply2..", demand = "..mem.mst_demand1.."/"..mem.mst_demand2..", reserve = "..mem.mst_reserve)
|
||||
end
|
||||
end
|
||||
|
||||
@ -184,18 +184,20 @@ local function connection_walk(pos, clbk)
|
||||
end
|
||||
end
|
||||
|
||||
-- if no power available
|
||||
local function consumer_turn_off(pos, mem)
|
||||
local pwr = PWR(pos)
|
||||
print("consumer_turn_off")
|
||||
mydbg("pwr", "consumer_turn_off")
|
||||
if pwr and pwr.on_nopower then
|
||||
pwr.on_nopower(pos, mem)
|
||||
end
|
||||
mem.pwr_state = NOPOWER
|
||||
mem.pwr_power_provided_cnt = -1
|
||||
end
|
||||
|
||||
local function consumer_turn_on(pos, mem)
|
||||
local pwr = PWR(pos)
|
||||
print("consumer_turn_on")
|
||||
mydbg("pwr", "consumer_turn_on")
|
||||
if pwr and pwr.on_power then
|
||||
pwr.on_power(pos, mem)
|
||||
end
|
||||
@ -250,9 +252,9 @@ local function handle_generator(mst_mem, mem, pos, power_available)
|
||||
end
|
||||
|
||||
local function handle_consumer(mst_mem, mem, pos, power_needed)
|
||||
print("handle_consumer", mem.pwr_state)
|
||||
mydbg("pwr", "handle_consumer", mem.pwr_state)
|
||||
if mem.pwr_state == NOPOWER then
|
||||
print("power_needed", power_needed,"mst_mem.demand1", mst_mem.mst_demand1)
|
||||
mydbg("pwr", "power_needed", power_needed,"mst_mem.demand1", mst_mem.mst_demand1)
|
||||
-- for next cycle
|
||||
mst_mem.mst_needed1 = mst_mem.mst_needed1 + power_needed
|
||||
-- current cycle
|
||||
@ -261,7 +263,7 @@ local function handle_consumer(mst_mem, mem, pos, power_needed)
|
||||
consumer_turn_on(pos, mem)
|
||||
end
|
||||
elseif mem.pwr_state == RUNNING then
|
||||
print("power_needed", power_needed,"mst_mem.demand1", mst_mem.mst_demand1)
|
||||
mydbg("pwr", "power_needed", power_needed,"mst_mem.demand1", mst_mem.mst_demand1)
|
||||
-- for next cycle
|
||||
mst_mem.mst_needed1 = mst_mem.mst_needed1 + power_needed
|
||||
-- current cycle
|
||||
@ -305,7 +307,7 @@ local function trigger_nodes(mst_pos, mst_mem, dec)
|
||||
connection_walk(mst_pos, function(pos, mem)
|
||||
mem.pwr_node_alive_cnt = (mem.pwr_node_alive_cnt or 1) - dec
|
||||
mem.pwr_power_provided_cnt = 2
|
||||
print("trigger_nodes", minetest.get_node(pos).name, mem.pwr_node_alive_cnt, mem.pwr_available2 or mem.pwr_available or mem.pwr_needed)
|
||||
mydbg("pwr", "trigger_nodes", minetest.get_node(pos).name, mem.pwr_node_alive_cnt, mem.pwr_available2 or mem.pwr_available or mem.pwr_needed)
|
||||
if mem.pwr_node_alive_cnt >= 0 then
|
||||
if mem.pwr_available then
|
||||
handle_generator(mst_mem, mem, pos, mem.pwr_available)
|
||||
@ -322,7 +324,7 @@ local function turn_off_nodes(mst_pos)
|
||||
Route = {}
|
||||
pos_already_reached(mst_pos)
|
||||
connection_walk(mst_pos, function(pos, mem)
|
||||
print("turn_off_nodes", minetest.get_node(pos).name)
|
||||
mydbg("pwr", "turn_off_nodes", minetest.get_node(pos).name)
|
||||
if (mem.pwr_node_alive_cnt or -1) >= 0 then
|
||||
if mem.pwr_needed then
|
||||
consumer_turn_off(pos, mem)
|
||||
@ -335,7 +337,7 @@ local function determine_new_master(pos, mem)
|
||||
local was_master = mem.pwr_is_master
|
||||
mem.pwr_is_master = false
|
||||
local mpos = determine_master(pos)
|
||||
--print("determine_new_master", S(mpos))
|
||||
mydbg("pwr", "determine_new_master", S(mpos))
|
||||
store_master(pos, mpos)
|
||||
if mpos then
|
||||
tubelib2.get_mem(mpos).pwr_is_master = true
|
||||
@ -350,7 +352,7 @@ end
|
||||
|
||||
-- called from master position
|
||||
local function power_distribution(pos, mem, dec)
|
||||
print("power_distribution")
|
||||
mydbg("pwr", "power_distribution")
|
||||
if mem.pwr_is_master then
|
||||
mem.mst_needed1 = 0
|
||||
mem.mst_needed2 = 0
|
||||
@ -367,7 +369,7 @@ end
|
||||
|
||||
-- To be called for each network change from any node
|
||||
function techage.power.network_changed(pos, mem)
|
||||
print("network_changed")
|
||||
mydbg("pwr", "network_changed")
|
||||
mem.pwr_node_alive_cnt = (mem.pwr_cycle_time or 2)/2 + 1
|
||||
if determine_new_master(pos, mem) then -- new master?
|
||||
power_distribution(pos, mem)
|
||||
@ -412,16 +414,16 @@ end
|
||||
--
|
||||
-- Consumer related functions
|
||||
--
|
||||
-- this is more a try to start, the start will be performed by consumer_turn_on()
|
||||
function techage.power.consumer_start(pos, mem, cycle_time, needed)
|
||||
mem.pwr_cycle_time = cycle_time
|
||||
mem.pwr_power_provided_cnt = 0
|
||||
mem.pwr_power_provided_cnt = 0 -- must be zero!
|
||||
mem.pwr_node_alive_cnt = 2
|
||||
mem.pwr_needed = needed
|
||||
mem.pwr_state = NOPOWER
|
||||
end
|
||||
|
||||
function techage.power.consumer_stop(pos, mem)
|
||||
mem.pwr_power_provided_cnt = 0
|
||||
mem.pwr_node_alive_cnt = 0
|
||||
mem.pwr_needed = 0
|
||||
mem.pwr_state = STOPPED
|
||||
@ -429,14 +431,12 @@ end
|
||||
|
||||
function techage.power.consumer_alive(pos, mem)
|
||||
migrate(pos, mem) -------------------------------- REMOVE
|
||||
print("consumer_alive", mem.pwr_power_provided_cnt, mem.pwr_cycle_time)
|
||||
mydbg("pwr", "consumer_alive", mem.pwr_power_provided_cnt, mem.pwr_cycle_time)
|
||||
mem.pwr_node_alive_cnt = (mem.pwr_cycle_time or 2)/2 + 1
|
||||
mem.pwr_power_provided_cnt = (mem.pwr_power_provided_cnt or 0) - (mem.pwr_cycle_time or 2)/2
|
||||
if mem.pwr_power_provided_cnt < 0 and mem.pwr_state == RUNNING then
|
||||
consumer_turn_off(pos, mem)
|
||||
return false
|
||||
end
|
||||
return mem.pwr_power_provided_cnt >= 0
|
||||
end
|
||||
|
||||
-- Lamp related function to speed up the turn on
|
||||
@ -494,7 +494,7 @@ end
|
||||
|
||||
function techage.power.secondary_alive(pos, mem, capa_curr, capa_max)
|
||||
migrate(pos, mem) -------------------------------- REMOVE
|
||||
--print("secondary_alive")
|
||||
mydbg("pwr", "secondary_alive")
|
||||
if capa_curr >= capa_max then
|
||||
mem.pwr_available2, mem.pwr_needed2 = mem.pwr_could_provide, 0 -- can provide only
|
||||
elseif capa_curr <= 0 then
|
||||
@ -505,7 +505,7 @@ function techage.power.secondary_alive(pos, mem, capa_curr, capa_max)
|
||||
|
||||
mem.pwr_node_alive_cnt = 2
|
||||
if mem.pwr_is_master then
|
||||
--print("secondary_alive is master")
|
||||
mydbg("pwr", "secondary_alive is master")
|
||||
power_distribution(pos, mem, 1)
|
||||
end
|
||||
return mem.pwr_provided or 0
|
||||
|
@ -136,7 +136,7 @@ function techage.power.register_node(names, pwr_def)
|
||||
-- To be called delayed, so that all network connections have been established
|
||||
minetest.after(0.2, network_changed, pos, mem)
|
||||
if pwr.after_tube_update then
|
||||
print("after_tube_update", node.name)
|
||||
mydbg("tlib", "after_tube_update", node.name)
|
||||
return pwr.after_tube_update(node, pos, out_dir, peer_pos, peer_in_dir)
|
||||
end
|
||||
end,
|
||||
@ -199,7 +199,7 @@ end
|
||||
|
||||
-- Used to turn on/off the power by means of a power switch
|
||||
function techage.power.power_cut(pos, dir, cable, cut)
|
||||
print("power_cut")
|
||||
mydbg("pwr", "power_cut")
|
||||
local npos = vector.add(pos, tubelib2.Dir6dToVector[dir or 0])
|
||||
|
||||
local node = minetest.get_node(npos)
|
||||
|
@ -35,7 +35,6 @@ local function switch_on(pos, node, clicker)
|
||||
if clicker and minetest.is_protected(pos, clicker:get_player_name()) then
|
||||
return
|
||||
end
|
||||
print("switch_on")
|
||||
node.name = "techage:powerswitch_on"
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.sound_play("techage_button", {
|
||||
@ -51,7 +50,6 @@ local function switch_off(pos, node, clicker)
|
||||
if clicker and minetest.is_protected(pos, clicker:get_player_name()) then
|
||||
return
|
||||
end
|
||||
print("switch_off")
|
||||
node.name = "techage:powerswitch"
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.get_node_timer(pos):stop()
|
||||
|
@ -24,7 +24,7 @@ local BURN_CYCLE_FACTOR = 0.8
|
||||
|
||||
local function node_timer(pos, elapsed)
|
||||
local mem = tubelib2.get_mem(pos)
|
||||
--print("firebox burn_cycles = "..(mem.burn_cycles or 0))
|
||||
mydbg("dbg", "firebox burn_cycles = "..(mem.burn_cycles or 0))
|
||||
if mem.running then
|
||||
local power = techage.transfer(
|
||||
{x=pos.x, y=pos.y+2, z=pos.z},
|
||||
|
Loading…
Reference in New Issue
Block a user