burnt_result_inventory cannot be accessed by inserters
This commit is contained in:
parent
79621f1b83
commit
f3433d902d
|
@ -19,7 +19,9 @@ The upgraded version has a stronger filtering effect. In addition, by using a mo
|
|||
The third and final upgrade of the air filtering machine features a larger radius of three chunks along with more air filtering per second.
|
||||
|
||||
#### Filter Types
|
||||
There are currently two types of filters: __expendable filters__ and __recyclable filters__. The first ones are easier to craft, but filter out less pollution and are destroyed upon use. __Recyclable filters__ are more expensive but can be refreshed with a bit of coal to be used again.
|
||||
There are currently two types of filters: __expendable filters__ and __recyclable filters__. The first ones are easier to craft, but filter out less pollution and are destroyed upon use. Recyclable filters are more expensive but can be refreshed with a bit of coal to be used again.
|
||||
|
||||
> Known issue: used air filters cannot be extracted from the first tier of air filter machines by inserters. Factorio does not feature inserters that can extract from burnt_result_inventory.
|
||||
|
||||
## Technical Details
|
||||
Some things to keep in mind when using this mod:
|
||||
|
|
|
@ -111,6 +111,46 @@ end
|
|||
-- # Update script #
|
||||
-- #####################
|
||||
|
||||
--function updateInserters(event)
|
||||
--for _, surface in pairs(game.surfaces) do
|
||||
-- local inserters = surface.find_entities_filtered({type="inserter"})
|
||||
-- for _, inserter in pairs(inserters) do
|
||||
-- updateInserter(inserter)
|
||||
-- end
|
||||
--end
|
||||
--end
|
||||
|
||||
--function updateInserter(inserter)
|
||||
--game.print(serpent.line(inserter.position))
|
||||
--local drop_target = inserter.drop_target
|
||||
--if drop_target == nil then return end
|
||||
--local pickup_target = inserter.pickup_target
|
||||
--if pickup_target == nil then return end
|
||||
--local burnt_result_inventory = pickup_target.get_burnt_result_inventory()
|
||||
--if burnt_result_inventory == nil then return end
|
||||
--if burnt_result_inventory.is_empty() then return end
|
||||
--if inserter.get_item_count() > 0 then return end
|
||||
--
|
||||
--
|
||||
--local contents = burnt_result_inventory.get_contents()
|
||||
--
|
||||
--
|
||||
--for item_name, count in pairs (contents) do
|
||||
-- fuel_item_name = item_name
|
||||
--end
|
||||
--
|
||||
--if inserter.get_item_count() < 1 then
|
||||
-- if inserter.held_stack.valid_for_read == false then
|
||||
-- if pickup_target.get_item_count(fuel_item_name) > 0 then
|
||||
-- inserter.held_stack.set_stack({name = fuel_item_name, count = 1})
|
||||
-- pickup_target.remove_item({name = fuel_item_name, count = 1})
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
--end
|
||||
--end
|
||||
|
||||
|
||||
function absorbPollution(event)
|
||||
-- game.print("insertPollution")
|
||||
for _, c in pairs(air_filtered_chunks) do
|
||||
|
@ -137,6 +177,9 @@ function absorbChunk(chunk)
|
|||
|
||||
local totalInsertedAmount = 0.0
|
||||
for _, filter in pairs(chunk.filters) do
|
||||
|
||||
local test = filter.get_output_inventory().insert({name="used-air-filter", count=1})
|
||||
game.print("Inserted " .. test .. " items in output")
|
||||
local toInsert = (getAbsorptionRate(filter) / totalAbsorptionRate) * toAbsorb
|
||||
if toInsert > 0 then
|
||||
local insertedAmount = filter.insert_fluid({ name = "pollution", amount = toInsert })
|
||||
|
@ -244,6 +287,8 @@ function generateFunctions()
|
|||
end
|
||||
end
|
||||
|
||||
--table.insert(functions, updateInserters)
|
||||
|
||||
return functions
|
||||
end
|
||||
|
||||
|
|
Reference in New Issue