Fix collision layer name: "resource-layer" -> "resource" (Factorio 2.0)

Caught by an in-game crash on real Factorio 2.0.77 (with Space
Exploration + Krastorio 2 loaded):

  Error while running event kafkatorio-events::on_chunk_generated
  Unknown collision-layer name: resource-layer

Factorio 2.0 made collision layers fully prototype-defined (previously
a fixed set of built-in names). Checked the official factorio-data
2.0.77 tag's core/lualib/collision-mask-defaults.lua: resource-type
entities now use layer name "resource", not "resource-layer". Fixed
both find_entities_filtered() call sites in EntityUpdateHandler.ts
that scan for resource entities around mined/placed tiles and newly
generated chunks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Lazzexus 2026-10-12 16:32:57 +02:00
parent 1e8ed08ca2
commit 8040abfd82

View file

@ -210,7 +210,7 @@ export class EntityUpdatesHandler {
): LuaEntity[] {
return surface.find_entities_filtered({
position: mapPosition,
collision_mask: "resource-layer",
collision_mask: "resource",
}
)
}
@ -223,7 +223,7 @@ export class EntityUpdatesHandler {
): LuaEntity[] {
return surface.find_entities_filtered({
area: area,
collision_mask: "resource-layer",
collision_mask: "resource",
}
)
}