Skip to content

Fix compatibility with Factorio 2.1 - #34

Open
carmopereira wants to merge 1 commit into
Klonan:masterfrom
carmopereira:factorio-2.1-compat
Open

Fix compatibility with Factorio 2.1#34
carmopereira wants to merge 1 commit into
Klonan:masterfrom
carmopereira:factorio-2.1-compat

Conversation

@carmopereira

Copy link
Copy Markdown

Summary

The mod currently fails to load on the Factorio 2.1 experimental branch. This fixes the breaking API changes:

  • LuaEntity.fluidbox / LuaFluidBox removed entirely — switched to LuaEntity.get_fluid / remove_fluid / fluids_count.
  • defines.inventory.assembling_machine_input renamed to defines.inventory.crafter_input.
  • RecipePrototype.category removed in favor of the categories array.
  • LuaEntity.active is now read-only — replaced writes with disabled_by_script = true.
  • data.raw.tool can be nil on a vanilla-only setup since 2.1 moved science packs off the tool/capsule item types; guarded the lookup in attack_proxy.lua.

info.json bumped to 2.0.3, factorio_version to 2.1, dependency to base >= 2.1.0.

Test plan

  • Loaded the mod standalone under Factorio 2.1 experimental; all four load-time/runtime errors above were hit and fixed one at a time until the mod loaded and a depot could mine and order drones.
  • Would appreciate a maintainer sanity-check on the fluid-depot behavior (mining depots that require fluid, e.g. uranium) since the old code paths there were rewritten.

🤖 Generated with Claude Code

Factorio 2.1 removed/renamed several modding APIs the mod relied on,
causing it to fail loading:

- LuaEntity.fluidbox / LuaFluidBox removed entirely; switched to
  LuaEntity.get_fluid/remove_fluid/fluids_count.
- defines.inventory.assembling_machine_input renamed to
  defines.inventory.crafter_input.
- RecipePrototype.category removed in favor of the categories array.
- LuaEntity.active is now read-only; use disabled_by_script instead.
- data.raw.tool can be nil on a vanilla-only setup since 2.1 moved
  science packs off the tool/capsule item types; guarded the lookup.

Bumped info.json to 2.0.3, factorio_version to 2.1, dependency to
base >= 2.1.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant