Skip to content

Update to Factorio 2.1 - #1654

Merged
grilledham merged 7 commits into
Refactorio:developfrom
lex:factorio-2.1
Oct 25, 2026
Merged

grilledham merged 7 commits into
Refactorio:developfrom
lex:factorio-2.1

Conversation

@lex

@lex lex commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Moves RedMew to Factorio 2.1, starting from current develop. It's based on RedRafe's #1569: his three API commits are cherry-picked as they were (they keep his authorship), and the rest fixes what came up when running every template's tests on 2.1.23. As RedRafe suggested in #1569, this is a fresh PR on develop rather than a rebase of the old 2.1 branch.

Once this is merged the servers need to run 2.1: the quick bar calls take a page and a slot, which 2.0 doesn't accept.

From #1569 (RedRafe)

  • entity.active = ... → entity.disabled_by_script (dump offline inventories, infinite storage chest, snake, turret delay, Crash Site, Frontier).
  • entity.fluidbox → get_fluid, set_fluid, get_fluid_capacity (enemy turrets, Crash Site).
  • defines.inventory.furnace_* and assembling_machine_* → crafter_* (auto stash, Crash Site, entity placement restriction).
  • Quick bar slots by page and slot (auto stash, player quick bars, April Fools' crazy toolbar).
  • .luacheckrc updated to the 2.1 API.

New here

  • Quick bar slots: in 2.1 get_quick_bar_slot returns a QuickBarSlot table, not a prototype, so .name on it was nil. Auto stash failed with "table index is nil" for any player with a quick bar slot set, and saving quick bars saved empty bars. Both now take the name from the slot's filter or item.
  • Terrain test helper: 2.1 removed LuaEntity.neighbours, which the Danger Ores terrain tests (Add in-game tests for Danger Ores #1631) use to check underground pairs. It now uses underground_belt_neighbour and fluidbox_neighbours.
  • Ore mined tests: since 2.1 a flow added with on_flow shows up in the production statistics two ticks later. The first test failed on every Danger Ores map, and "other items do not count" passed without checking anything. Each test now waits for its own flow. The score itself is fine: it reads the statistics every 10 seconds.
  • CI runs the latest stable 2.1 (FACTORIO_LINE: "2.1"), and AGENTS.md says the scenario targets 2.1 and lists the removed 2.0 API to avoid.

Left for follow-ups

These parts of #1569 follow 2.1 versions of mods or add features, so they're in PRs stacked on this one:

Tests

  • Every scenario template on a local 2.1.23: 70 templates pass with 0 failures (69 before Bloom Add the Danger Ores Bloom map #1653 merged), and the 17 mod-pack templates are skipped as usual. Before the last three fixes, the ore mined test failed on all 39 Danger Ores templates that run. Making the ore counter skip coal fails the updated test.
  • A grep of everything 2.1 removed or renamed (from its changelog) finds no other use, including code no test reaches.
  • luacheck .: 0 warnings / 0 errors.

🤖 Generated with Claude Code

RedRafe and others added 7 commits October 25, 2026 13:08
In 2.1 get_quick_bar_slot returns a table, {type, filter} or {type,
item}, not an item prototype, so .name on it was nil: auto stash failed
with "table index is nil" for any player with a quick bar slot set, and
saving quick bars saved empty bars. Both now take the name from the
slot's filter or item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.1 removed LuaEntity.neighbours. Underground belts now have
underground_belt_neighbour and pipes-to-ground fluidbox_neighbours,
which the Citadel, Fault Lines and Rivers tests use through connected().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since 2.1 a flow added with on_flow shows up in the statistics two ticks
later, so the tests read the counts before it had landed: the first
failed on every Danger Ores map, and "other items do not count" passed
without checking anything. Each test now waits for its own flow first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI now tests the latest stable 2.1 release, and AGENTS.md says the
scenario targets 2.1 and lists the 2.0 API it removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@grilledham
grilledham merged commit ad0c4a3 into Refactorio:develop Oct 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants