Repository navigation
fix: guard villager bed lookups by region ownership - #526
Open
PluginsKers wants to merge 1 commit into
Open
PluginsKers wants to merge 1 commit into
PluginsKers wants to merge 1 commit into
Conversation
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.
JumpOnBedretainstargetBedwhile a villager can move to another region.canStillUsereads that cached position throughisJumpable. An unloaded foreign chunk reachesServerChunkCache.syncLoadand throws an ownership exception. When this runs during passenger ticking, the exception can propagate to the vehicle'sguardEntityTickboundary and discard the vehicle.Check
TickThread.isTickThreadFor(level, bodyPos)in the sharedisJumpablehelper before reading block state. This coverscanStillUse,onOrOverBed, andonBedSurface, including start, walk-timeout, and jump-timeout checks. Preserve 26.3'sVILLAGER_BABIES_CAN_JUMP_ON_BEDtag. A rejected target takes the existingBehavior.tickOrStop -> doStop -> JumpOnBed.stoppath, clearing the retained target and jump counters without changingNEAREST_BEDorWALK_TARGET.VillagerGoalPackagesregistersJumpOnBedin its play and idle groups. The production stack includestickPassengerand bothrideTickframes before the AI failure.Level.guardEntityTickdiscards the non-player entity passed to its outer boundary; the stack alone does not identify the production vehicle type or establish inventory loss.Complete captured production call chain (26.2-7-14b7fee, entry to failure)
Original exception stack. These method names and line numbers belong to the captured 26.2 build. In 26.3,
isBedis namedisJumpable.597e41371802648e0455fc1571192ee1c83fca2band this PR's commit for the fixed variant. Use the same probe JAR in fresh, loopback-only server directories and runjava -Xms1G -Xmx2G -Duser.language=en -Dfolia.probe=bed -jar folia.jar --nogui.(0, 0). Keep chunk(1024, 0)unloaded and confirm it is not owned. SetNEAREST_BEDto(16387, 65, 3), leaveWALK_TARGETabsent, and callnew JumpOnBed(0.5f).tryStart(level, villager, 0L)to retain the target.behavior.tickOrStop(level, villager, 1L)insidelevel.guardEntityTick, passing the boat as the guarded entity. The unchanged server logsCannot asynchronously load chunksand removes the boat. With the guard, the behavior stops, the boat and passenger remain, the target/counters reset, both memories remain unchanged, and the foreign chunk stays unloaded.teleportAsync, then confirms stop/restart on a local bed. Other controls exercise real jump velocity, walk timeout, adult/non-bed cases, and same-coordinate beds across dimensions.NEAREST_BEDstores aBlockPos, so its existing dimension-local interpretation is preserved.The mounted fixture reproduces the guard boundary with a real boat and passenger; it does not drive the entire autonomous
rideTickjourney. That caller path is evidenced by the production stack. The paired baseline stops at the mounted unloaded-bed failure after its earlier controls.The current 26.3 failure stack, baseline log, and fixed log are pinned alongside the fixture. The recorded fixed runtime contains the three independent guards; this PR contains only the bed-lookup change. The reproductions invoke real behaviors on owner threads with autonomous AI disabled; separate single-fix runtime JARs and complete autonomous gameplay runs were not recorded. Read assertion markers in the logs, since the fixture shuts down normally even after an assertion fails.
AI tools assisted the investigation, implementation, reproduction, and this description.