forked from mrkubax10/industrialtest
Pipeworks compatibility: Chargepads
This commit is contained in:
parent
bc3283be7c
commit
3c52a3e6f4
@ -322,3 +322,13 @@ for _,name in ipairs(industrialtest.internal.simpleElectricItemProcessors) do
|
|||||||
{listname="src"}
|
{listname="src"}
|
||||||
},"dst")
|
},"dst")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for _,name in ipairs(industrialtest.internal.chargepads) do
|
||||||
|
addPipeworksCompatibility(name,{
|
||||||
|
{
|
||||||
|
y=1,
|
||||||
|
listname="discharged"
|
||||||
|
},
|
||||||
|
{listname="charged"}
|
||||||
|
},"charged")
|
||||||
|
end
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
local S=minetest.get_translator("industrialtest")
|
local S=minetest.get_translator("industrialtest")
|
||||||
|
|
||||||
local chargepad={}
|
local chargepad={}
|
||||||
|
industrialtest.internal.chargepads={}
|
||||||
|
|
||||||
local function chargePlayer(meta,player,flow)
|
local function chargePlayer(meta,player,flow)
|
||||||
local inv
|
local inv
|
||||||
@ -197,24 +198,16 @@ local function registerChargepad(config)
|
|||||||
getFormspec=chargepad.getFormspec,
|
getFormspec=chargepad.getFormspec,
|
||||||
onConstruct=chargepad.onConstruct
|
onConstruct=chargepad.onConstruct
|
||||||
})
|
})
|
||||||
minetest.register_abm({
|
|
||||||
label="Chargepad updating",
|
|
||||||
nodenames={
|
|
||||||
"industrialtest:"..config.name,
|
|
||||||
"industrialtest:"..config.name.."_active"
|
|
||||||
},
|
|
||||||
interval=industrialtest.updateDelay,
|
|
||||||
chance=1,
|
|
||||||
action=chargepad.action
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
output="industrialtest:"..config.name,
|
output="industrialtest:"..config.name,
|
||||||
recipe={
|
recipe={
|
||||||
{"industrialtest:electronic_circuit",industrialtest.elementKeys.stoneSlab,"industrialtest:electronic_circuit"},
|
{"industrialtest:electronic_circuit",industrialtest.elementKeys.stoneSlab,"industrialtest:electronic_circuit"},
|
||||||
{industrialtest.elementKeys.rubber,"industrialtest:"..config.basePowerStorage,industrialtest.elementKeys.rubber}
|
{industrialtest.elementKeys.rubber,"industrialtest:"..config.basePowerStorage,industrialtest.elementKeys.rubber}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
table.insert(industrialtest.internal.chargepads,"industrialtest:"..config.name)
|
||||||
|
table.insert(industrialtest.internal.chargepads,"industrialtest:"..config.name.."_active")
|
||||||
end
|
end
|
||||||
|
|
||||||
registerChargepad({
|
registerChargepad({
|
||||||
@ -264,3 +257,11 @@ registerChargepad({
|
|||||||
requiresWrench=true,
|
requiresWrench=true,
|
||||||
basePowerStorage="mfsu"
|
basePowerStorage="mfsu"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
label="Chargepad updating",
|
||||||
|
nodenames=industrialtest.internal.chargepads,
|
||||||
|
interval=industrialtest.updateDelay,
|
||||||
|
chance=1,
|
||||||
|
action=chargepad.action
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user