Re-add Logistica compatibility
This commit is contained in:
@@ -167,6 +167,13 @@ function industrialtest.GeothermalGenerator.onConstruct(self,pos)
|
||||
industrialtest.ActivatedElectricMachine.onConstruct(self,pos)
|
||||
end
|
||||
|
||||
function industrialtest.GeothermalGenerator.update(self,pos,elapsed,meta,inv)
|
||||
local srcSlot=inv:get_stack("src",1)
|
||||
local dstSlot=inv:get_stack("dst",1)
|
||||
local shouldUpdateFormspec=takeFuelFromItem(self,pos)
|
||||
return (not srcSlot:is_empty() and dstSlot:get_free_space()>0 and not industrialtest.api.isFluidStorageFull(meta)),shouldUpdateFormspec
|
||||
end
|
||||
|
||||
function industrialtest.GeothermalGenerator.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
|
||||
return math.min(allowMetadataInventoryMove(pos,fromList,fromIndex,toList,toIndex,count),industrialtest.ActivatedElectricMachine.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count))
|
||||
end
|
||||
@@ -191,16 +198,22 @@ end
|
||||
|
||||
function industrialtest.GeothermalGenerator.shouldActivate(self,pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
local srcSlot=inv:get_stack("src",1)
|
||||
local dstSlot=inv:get_stack("dst",1)
|
||||
local fluidAmount=meta:get_float("fluidAmount")
|
||||
|
||||
return fluidAmount>0 and not industrialtest.api.isFullyCharged(meta)
|
||||
return (fluidAmount>0 or (not srcSlot:is_empty() and dstSlot:get_free_space()>0)) and not industrialtest.api.isFullyCharged(meta)
|
||||
end
|
||||
|
||||
function industrialtest.GeothermalGenerator.shouldDeactivate(self,pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
local srcSlot=inv:get_stack("src",1)
|
||||
local dstSlot=inv:get_stack("dst",1)
|
||||
local fluidAmount=meta:get_float("fluidAmount")
|
||||
|
||||
return fluidAmount<=0 or industrialtest.api.isFullyCharged(meta)
|
||||
return (fluidAmount<=0 and (srcSlot:is_empty() or dstSlot:get_free_space()==0)) or industrialtest.api.isFullyCharged(meta)
|
||||
end
|
||||
|
||||
function industrialtest.GeothermalGenerator.activeUpdate(self,pos,elapsed)
|
||||
@@ -270,9 +283,12 @@ end
|
||||
|
||||
function industrialtest.WaterMill.canUpdate(self,pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
local srcSlot=inv:get_stack("src",1)
|
||||
local dstSlot=inv:get_stack("dst",1)
|
||||
local fluidAmount=meta:get_float("fluidAmount")
|
||||
|
||||
return fluidAmount>0 and not industrialtest.api.isFullyCharged(meta)
|
||||
return (fluidAmount>0 or (not srcSlot:is_empty() and dstSlot:get_free_space()>0)) and not industrialtest.api.isFullyCharged(meta)
|
||||
end
|
||||
|
||||
function industrialtest.WaterMill.update(self,pos,elapsed)
|
||||
|
||||
Reference in New Issue
Block a user