Take into account machine ioConfig when transferring power

This commit is contained in:
2023-03-01 21:19:00 +01:00
parent 174798262b
commit 319d3102f6
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,6 @@ local S=minetest.get_translator("industrialtest")
-- Generators
local function generatorFormspec(fuelPercent,charged)
minetest.chat_send_all(charged)
local formspec={
industrialtest.formspecVersion(),
"size[10.8,12]",
@@ -89,6 +88,7 @@ local definition={
meta:set_int("fuelTime",fuelTime)
industrialtest.api.addPower(meta,100)
meta:set_string("formspec",generatorFormspec(fuelTime/meta:get_int("maxFuelTime")*100,meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")))
industrialtest.api.powerFlow(pos)
if fuelTime>0 or fuelList[1]:get_count()>0 then
return true
end