forked from mrkubax10/industrialtest
Normalize power flow
This commit is contained in:
parent
70db00304f
commit
8da3968a46
6
api.lua
6
api.lua
@ -21,6 +21,12 @@ industrialtest.api.maceratorRecipes={}
|
|||||||
industrialtest.api.compressorRecipes={}
|
industrialtest.api.compressorRecipes={}
|
||||||
industrialtest.api.extractorRecipes={}
|
industrialtest.api.extractorRecipes={}
|
||||||
|
|
||||||
|
industrialtest.api.lvPowerFlow=600
|
||||||
|
industrialtest.api.mvPowerFlow=2400
|
||||||
|
industrialtest.api.hvPowerFlow=10200
|
||||||
|
industrialtest.api.evPowerFlow=40800
|
||||||
|
industrialtest.api.ivPowerFlow=163800
|
||||||
|
|
||||||
local function clamp(num,min,max)
|
local function clamp(num,min,max)
|
||||||
return math.max(math.min(num,max),min)
|
return math.max(math.min(num,max),min)
|
||||||
end
|
end
|
||||||
|
@ -196,4 +196,4 @@ local function registerCable(name,displayName,material,size,flow)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
registerCable("copper","Copper",industrialtest.elementKeys.copperIngot,0.15,216)
|
registerCable("copper","Copper",industrialtest.elementKeys.copperIngot,0.15,industrialtest.api.mvPowerFlow)
|
||||||
|
@ -22,7 +22,7 @@ minetest.register_tool("industrialtest:re_battery",{
|
|||||||
inventory_image="industrialtest_re_battery.png",
|
inventory_image="industrialtest_re_battery.png",
|
||||||
_industrialtest_powerStorage=true,
|
_industrialtest_powerStorage=true,
|
||||||
_industrialtest_powerCapacity=7000,
|
_industrialtest_powerCapacity=7000,
|
||||||
_industrialtest_powerFlow=200
|
_industrialtest_powerFlow=industrialtest.api.lvPowerFlow
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
|
10
machines.lua
10
machines.lua
@ -92,7 +92,7 @@ local definition={
|
|||||||
meta:set_string("formspec",generatorFormspec(0,0))
|
meta:set_string("formspec",generatorFormspec(0,0))
|
||||||
meta:set_int("fuelTime",0)
|
meta:set_int("fuelTime",0)
|
||||||
meta:set_int("maxFuelTime",1)
|
meta:set_int("maxFuelTime",1)
|
||||||
industrialtest.api.addPowerStorage(meta,7000,100,"oooooo")
|
industrialtest.api.addPowerStorage(meta,7000,industrialtest.api.lvPowerFlow,"oooooo")
|
||||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
end,
|
end,
|
||||||
on_timer=function(pos,elapsed)
|
on_timer=function(pos,elapsed)
|
||||||
@ -734,7 +734,7 @@ registerSimpleElectricItemProcessor({
|
|||||||
name="electric_furnace",
|
name="electric_furnace",
|
||||||
displayName="Electric Furnace",
|
displayName="Electric Furnace",
|
||||||
capacity=416,
|
capacity=416,
|
||||||
flow=390,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=60,
|
opPower=60,
|
||||||
method="cooking",
|
method="cooking",
|
||||||
efficiency=0.5
|
efficiency=0.5
|
||||||
@ -762,7 +762,7 @@ registerSimpleElectricItemProcessor({
|
|||||||
name="macerator",
|
name="macerator",
|
||||||
displayName="Macerator",
|
displayName="Macerator",
|
||||||
capacity=1200,
|
capacity=1200,
|
||||||
flow=600,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=100,
|
opPower=100,
|
||||||
method="industrialtest.macerating",
|
method="industrialtest.macerating",
|
||||||
efficiency=1
|
efficiency=1
|
||||||
@ -781,7 +781,7 @@ registerSimpleElectricItemProcessor({
|
|||||||
name="compressor",
|
name="compressor",
|
||||||
displayName="Compressor",
|
displayName="Compressor",
|
||||||
capacity=1400,
|
capacity=1400,
|
||||||
flow=600,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=120,
|
opPower=120,
|
||||||
method="industrialtest.compressing",
|
method="industrialtest.compressing",
|
||||||
efficiency=1
|
efficiency=1
|
||||||
@ -800,7 +800,7 @@ registerSimpleElectricItemProcessor({
|
|||||||
name="extractor",
|
name="extractor",
|
||||||
displayName="Extractor",
|
displayName="Extractor",
|
||||||
capacity=900,
|
capacity=900,
|
||||||
flow=600,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=100,
|
opPower=100,
|
||||||
method="industrialtest.extracting",
|
method="industrialtest.extracting",
|
||||||
efficiency=1
|
efficiency=1
|
||||||
|
Loading…
Reference in New Issue
Block a user