Repository navigation
test-entitydead: entity dead/spool fixes - #2
Draft
MLG-SERBUR wants to merge 8 commits into
Draft
MLG-SERBUR wants to merge 8 commits into
MLG-SERBUR wants to merge 8 commits into
Conversation
MLG-SERBUR
force-pushed
the
test-entitydead
branch
from
August 22, 2026 05:49
44be2ac to
d1367f8
Compare
Return immediately after selfDestruct() and never re-bind a dead instance via Bukkit.getEntity(uuid).
Resolves startup race where Bukkit.getEntity(uuid) returned null because the chunk was not yet materialized after the async chunk load request. Force a synchronous load before lookup, and re-attempt spooling any un-spun entity spinner when its chunk loads.
…stics The held entity reference goes stale after its chunk unloads/reloads, so entity.isDead() on the stale ref falsely killed the spinner on rejoin. resolveEntity() now re-fetches the live entity by UUID first: only self-destructs if no live entity exists, otherwise pauses while unloaded and rebinds when the chunk reloads. Adds WARNING/debug logging in the spin loop and in spoolEntitySpinner/ChunkLoadEvent to trace spool and dead-detection.
spoolEntitySpinner() calls World.loadChunk(), which fires ChunkLoadEvent synchronously; the new ChunkLoadEvent handler re-entered spoolEntitySpinner for the same UUID before the outer call registered it, producing two spin tasks (only one tracked by taskID, leaking the other). Guard with a spoolingNow set so a UUID mid-spool is skipped.
resolveEntity() now logs a full snapshot whenever the held reference is unhealthy (heldDead/heldValid, liveLookup present/absent, liveDead/liveValid, sameInstance) plus an originalLogicWouldSelfDestruct flag, throttled to state transitions. Removed the forced World.loadChunk() from spoolEntitySpinner: unspun espinners now wait for their natural ChunkLoadEvent instead of force-loading/generating chunks at startup.
…reference handling
…lveEntity with refreshEntity
…y with inline checks
MLG-SERBUR
force-pushed
the
test-entitydead
branch
from
August 22, 2026 09:03
a65472d to
31a5569
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR to review diff of
test-entitydeadagainstenum-validator.Changes so far