Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/Frozen' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Septiple committed Sep 11, 2024
2 parents 93973bb + 5adbe58 commit fa98ed4
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/factoriotest-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ permissions:
jobs:
test-pull-request:
name: PR
uses: pyanodon/pyanodontests/.github/workflows/pytest.yml@v1
uses: pyanodon/pyanodontests/.github/workflows/pytest.yml@v1.5.0
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
test_branch: ${{ github.head_ref || github.ref_name }}
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/factoriotest-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ permissions:
jobs:
test-push:
name: Push
uses: pyanodon/pyanodontests/.github/workflows/pytest.yml@v1
uses: pyanodon/pyanodontests/.github/workflows/pytest.yml@v1.5.0
with:
repository: ${{ github.repository }}
ref: ${{ github.sha }}
test_branch: ${{ github.head_ref || github.ref_name }}
secrets: inherit

20 changes: 18 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.27
Date: 2024-8-23
Bugfixes:
- Fix productivity blacklist being overly general and including recipes like empty barrels
- add compatibility for minibuffer so its in automation science with storage tank tech
---------------------------------------------------------------------------------------------------
Version: 0.2.26
Date: 2024-8-7
Changes:
- Remove incompatibility with Science pack dependencies mod
---------------------------------------------------------------------------------------------------
Version: 0.2.25
Date: 2024-8-4
Changes:
- Fix crash on load with pyblock
---------------------------------------------------------------------------------------------------
Version: 0.2.24
Date: 2024-??-??
Date: 2024-7-29
Changes:
- Whenever pyPP encounters a dependency cycle, it will now print the items involved in the cycle to the logs.
- Fix productivity blacklist being overly general and including recipes like empty barrels
- Added an incompatiblity with the science-pack-dependencies mod. (https://github.com/pyanodon/pybugreports/issues/505)
- adjusted most entity recipe times for easier copy pasting to requester chests
---------------------------------------------------------------------------------------------------
Version: 0.2.23
Date: 2024-4-25
Expand Down
87 changes: 75 additions & 12 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,78 @@ end
for _, recipe in pairs(data.raw.recipe) do
recipe.always_show_products = true
recipe.always_show_made_in = true
local has_logged = false
if recipe.results or recipe.result then
if not recipe.results then
recipe.results = {{name = recipe.result, amount = recipe.result_count or 1, type = 'item'}}
recipe.result = nil
recipe.result_count = nil
end
-- Skip if recipe only produces the item, not uses it as a catalyst. Fluids are probably blacklisted for other reasons.
if #recipe.results ~= 1 or recipe.results[1].type ~= 'fluid' then
for i, result in pairs(recipe.results) do
local name = result.name or result[1]
local amount = result.amount or result[2]
if name and config.NON_PRODDABLE_ITEMS[name] and not result.catalyst_amount then
if result[1] then
recipe.results[i] = {type = result.type or 'item', name = name, amount = amount, catalyst_amount = amount, [1] = nil, [2] = nil}
else
result.catalyst_amount = amount
end
end
-- Skip if recipe only produces the item, not uses it as a catalyst.
if #recipe.results == 1 then
goto NEXT_RECIPE
end
for i, result in pairs(recipe.results) do
local name = result.name or result[1]
local amount = result.amount or result[2]
if not name or not config.NON_PRODDABLE_ITEMS[name] or result.catalyst_amount then
goto NEXT_RESULT
end
-- Convert to an explicitly long-form result format
if result[1] then
recipe.results[i] = {
type = result.type or 'item',
name = name,
amount = amount,
catalyst_amount = amount,
[1] = nil,
[2] = nil
}
else -- Just set the catalyst amount
result.catalyst_amount = amount
end
::NEXT_RESULT::
end
end
::NEXT_RECIPE::
end

-- Scan for cages
if dev_mode then
for recipe_name, recipe in pairs(data.raw.recipe) do
if recipe_name:find('%-pyvoid$') or recipe_name:find('^biomass%-') then
goto NEXT_RECIPE_CAGECHECK
end
if not recipe.ingredients then
goto NEXT_RECIPE_CAGECHECK
end
local cage_input = false
local cage_output = false
for i, ingredient in pairs(recipe.ingredients) do
local item_name = ingredient[1] or ingredient.name
if item_name:find('caged') then
cage_input = true
break
end
end
if not cage_input then
goto NEXT_RECIPE_CAGECHECK
end
if not recipe.results then
-- Don't log, probably a voiding recipe
goto NEXT_RECIPE_CAGECHECK
end
for i, result in pairs(recipe.results) do
local item_name = result[1] or result.name
if item_name:find('cage') then -- could be the same caged animal or an empty cage
cage_output = true
break
end
end
if cage_input and not cage_output then
log(string.format('Recipe \'%s\' takes a caged animal as input but does not return a cage', recipe_name))
end
::NEXT_RECIPE_CAGECHECK::
end
end

Expand Down Expand Up @@ -343,6 +395,17 @@ for _, type in pairs{'furnace', 'assembling-machine'} do
end
end

-- infrastructure times scale with tiers, makes pasting to requester chests and buffering inside assemblers better
for _, type in pairs{'furnace', 'assembling-machine', 'mining-drill', 'lab'} do
for _, prototype in pairs(data.raw[type]) do
local name = prototype.name
local tier = tonumber(string.sub(name, -1)) or 1
if data.raw.recipe[name] and data.raw.recipe[name].energy_required == .5 then
data.raw.recipe[name].energy_required = math.max(tier, 1)
end
end
end

-- YAFC
if type(data.data_crawler) == 'string' and string.sub(data.data_crawler, 1, 5) == 'yafc ' then
require 'prototypes/yafc'
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pypostprocessing",
"version": "0.2.24",
"version": "0.2.27",
"factorio_version": "1.1",
"title": "Pyanodons Post-processing",
"author": "Pyanodon, Shadowglass",
Expand Down
2 changes: 1 addition & 1 deletion lib.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if py then return py end
require 'lib.lib'
return py
return py
4 changes: 4 additions & 0 deletions prototypes/functions/auto_tech.lua
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ function auto_tech:topo_sort_with_sp(fg, sp_graph, science_packs)
end
end

for _, link in pairs(sp_links) do
fg:remove_link(link.from, link.to, link.from.name)
end

local ts = fz_topo.create(fg)
local error_found, errors = ts:run(false, self.verbose_logging)

Expand Down
4 changes: 4 additions & 0 deletions prototypes/functions/compatibility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -593,3 +593,7 @@ if mods['jetpack'] and mods['pyrawores'] and mods['pypetroleumhandling'] then
TECHNOLOGY('jetpack-3'):set_fields{prerequisites = {'jetpack-2'}}:remove_pack('production-science-pack'):remove_pack('py-science-pack-4'):remove_pack('utility-science-pack'):add_pack('py-science-pack-3'):add_prereq(mods['pyalienlife'] and 'py-science-pack-mk03' or 'chemical-science-pack')
TECHNOLOGY('jetpack-4'):set_fields{prerequisites = {'jetpack-3'}}:remove_pack('space-science-pack'):add_prereq('utility-science-pack')
end

if mods["extra-storage-tank-minibuffer"] then
TECHNOLOGY("minibuffer"):remove_pack("logistic-science-pack")
end

0 comments on commit fa98ed4

Please sign in to comment.