forked from mrkubax10/industrialtest
Nuclear Reactor Chamber can be used to expand Nuclear Reactor storage capacity
This commit is contained in:
@@ -95,9 +95,6 @@ machine.onConstruct=function(pos,config)
|
||||
local inv=meta:get_inventory()
|
||||
|
||||
industrialtest.api.addPowerStorage(meta,config.capacity,config.flow,config.ioConfig)
|
||||
if not config.withoutFormspec then
|
||||
meta:set_string("formspec",machine.getFormspec(pos,config))
|
||||
end
|
||||
|
||||
if config.groups then
|
||||
if config.groups._industrialtest_hasPowerInput then
|
||||
@@ -130,10 +127,14 @@ machine.onConstruct=function(pos,config)
|
||||
config.onConstruct(pos,meta,inv)
|
||||
end
|
||||
|
||||
if not config.withoutFormspec then
|
||||
meta:set_string("formspec",machine.getFormspec(pos,config))
|
||||
end
|
||||
|
||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||
end
|
||||
|
||||
machine.onDestruct=function(pos)
|
||||
machine.onDestruct=function(pos,config)
|
||||
local meta=minetest.get_meta(pos)
|
||||
if industrialtest.api.isNetworkMaster(meta) then
|
||||
local network=industrialtest.api.createNetworkMap(pos,true)
|
||||
@@ -155,6 +156,9 @@ machine.onDestruct=function(pos)
|
||||
industrialtest.api.removeNodeFromNetwork(network,pos)
|
||||
end
|
||||
end
|
||||
if config.onDestruct then
|
||||
config.onDestruct(pos)
|
||||
end
|
||||
end
|
||||
|
||||
machine.onTimer=function(pos,elapsed,config)
|
||||
@@ -287,7 +291,9 @@ function industrialtest.internal.registerMachine(config)
|
||||
on_construct=function(pos)
|
||||
machine.onConstruct(pos,config)
|
||||
end,
|
||||
on_destruct=machine.onDestruct,
|
||||
on_destruct=function(pos)
|
||||
machine.onDestruct(pos,config)
|
||||
end,
|
||||
on_timer=function(pos,elapsed)
|
||||
local shouldRerunTimer,_=machine.onTimer(pos,elapsed,config)
|
||||
return shouldRerunTimer
|
||||
@@ -321,6 +327,12 @@ function industrialtest.internal.registerMachine(config)
|
||||
end,
|
||||
_industrialtest_updateFormspec=function(pos)
|
||||
machine.updateFormspec(pos,config)
|
||||
end,
|
||||
_industrialtest_getFormspec=function(pos)
|
||||
if config.withoutFormspec then
|
||||
return ""
|
||||
end
|
||||
return machine.getFormspec(pos,config)
|
||||
end
|
||||
}
|
||||
if industrialtest.mtgAvailable then
|
||||
|
||||
Reference in New Issue
Block a user