Skip to content

claude/entity-despawn-prevention-4gAps#7

Merged
holty07 merged 3 commits into
mainfrom
claude/entity-despawn-prevention-4gAps
May 28, 2026
Merged

claude/entity-despawn-prevention-4gAps#7
holty07 merged 3 commits into
mainfrom
claude/entity-despawn-prevention-4gAps

Conversation

@holty07

@holty07 holty07 commented May 28, 2026

Copy link
Copy Markdown
Owner

Forces workers to load the chunk they are in to prevent despawning.

claude and others added 3 commits May 27, 2026 14:58
Worker entities were freezing/disappearing when the player moved beyond
simulation distance because their chunks unloaded. This adds chunk
force-loading tied to each worker block's lifecycle:

- WorkerChunkManager (SavedData) tracks reference counts per chunk;
  setChunkForced is called only on first claim and last release, so
  multiple workers in the same chunk are handled correctly.
- GameEventSubscriber listens for ChunkEvent.Load to auto-claim chunks
  for worker blocks that existed before this update (migration path).
- All four block types (Farmer, Miner, Lumberjack, Warehouse) claim
  their chunk on onPlace and release it on onRemove.
- All four entity types call setPersistenceRequired() as an additional
  guard against any edge-case natural despawning.

https://claude.ai/code/session_016MRtBVQWg7kfgJFtG8dCEM
In 1.21 the SavedData abstract method signature changed to
save(CompoundTag, HolderLookup.Provider) and the Factory deserializer
expects BiFunction<CompoundTag, HolderLookup.Provider, T>. Updated
save and load accordingly, and used explicit SavedData.Factory<> type
to resolve diamond-inference failure.

https://claude.ai/code/session_016MRtBVQWg7kfgJFtG8dCEM
@holty07 holty07 merged commit 75c6b19 into main May 28, 2026
@holty07 holty07 deleted the claude/entity-despawn-prevention-4gAps branch May 29, 2026 05:50
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.

2 participants