Kafkatorio/modules/events-mod
Lazzexus 05389d5954 Filter resource entities by prototype type, not collision layer
Caught by another in-game crash: "Entity is not resource." when
reading entity.amount. The previous fix (collision_mask: "resource")
was still wrong - collision layers and entity type are decoupled in
Factorio 2.0, so find_entities_filtered({collision_mask: "resource"})
can return non-resource entities that merely opted into the same
collision layer (likely something from Space Exploration or
Krastorio 2). entity.amount/initial_amount only exist on entities
whose prototype type is actually "resource".

Filtering by type: "resource" directly targets the right entities
and is simpler than inferring it via collision mask in the first
place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 16:36:12 +02:00
..
src/main Filter resource entities by prototype type, not collision layer 2026-10-12 16:36:12 +02:00
build.gradle.kts Port events-mod to Factorio 2.0.77, declare SE/Krastorio 2 compatibility 2026-10-12 15:06:30 +02:00
mod-portal-description.md big ol' refactor of the Gradle Factorio Mod 2022-12-18 01:41:14 +01:00
package-lock.json Fix compile errors surfaced by actually building against Factorio 2.0.77 2026-10-12 15:27:50 +02:00
package.json Fix compile errors surfaced by actually building against Factorio 2.0.77 2026-10-12 15:27:50 +02:00
tsconfig.json Fix mod zip layout: set tsconfig rootDir so control.lua lands at mod root 2026-10-12 15:53:03 +02:00