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"}
|
||||
},"dst")
|
||||
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 chargepad={}
|
||||
industrialtest.internal.chargepads={}
|
||||
|
||||
local function chargePlayer(meta,player,flow)
|
||||
local inv
|
||||
@ -197,24 +198,16 @@ local function registerChargepad(config)
|
||||
getFormspec=chargepad.getFormspec,
|
||||
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({
|
||||
type="shaped",
|
||||
output="industrialtest:"..config.name,
|
||||
recipe={
|
||||
{"industrialtest:electronic_circuit",industrialtest.elementKeys.stoneSlab,"industrialtest:electronic_circuit"},
|
||||
{industrialtest.elementKeys.rubber,"industrialtest:"..config.basePowerStorage,industrialtest.elementKeys.rubber}
|
||||
}
|
||||
})
|
||||
type="shaped",
|
||||
output="industrialtest:"..config.name,
|
||||
recipe={
|
||||
{"industrialtest:electronic_circuit",industrialtest.elementKeys.stoneSlab,"industrialtest:electronic_circuit"},
|
||||
{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
|
||||
|
||||
registerChargepad({
|
||||
@ -264,3 +257,11 @@ registerChargepad({
|
||||
requiresWrench=true,
|
||||
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