Skip to content

Fix missed chest open callbacks for max-range opens - #14141

Open
entrapy wants to merge 1 commit into
PaperMC:mainfrom
entrapy:fix-chest-openers-max-range
Open

Fix missed chest open callbacks for max-range opens#14141
entrapy wants to merge 1 commit into
PaperMC:mainfrom
entrapy:fix-chest-openers-max-range

Conversation

@entrapy

@entrapy entrapy commented Aug 4, 2026

Copy link
Copy Markdown

Simple summary:

Delayed open/close path (introduced by "Delay open/close callbacks for chests") never adopts the opener's interaction range so the first scan is too small and can miss the player who opened the container.

This allows a player from ~4.8-5.5 blocks to open chests and other containers without activating redstone.

Simple explanation:

The code only schedules a recheck, but never does it properly; unlike the immediate path it does not do maxInteractionRange = max(arg, this.maxInteractionRange). The recheck's viewer scan uses AABB(pos).inflate(this.maxInteractionRange + 4.0), which for a fresh counter is only a 4-block box - while the server accepts block interactions from up to blockInteractionRange + 1.0 (5.5 blocks by default).

  • openCount stays at 0, so onOpen never runs which means the lid doesn't open, and GameEvent.CONTAINER_OPEN never fires which means redstone does not trigger.

  • recheckOpeners only reschedules itself while openCount > 0, so no further recheck happens - the container stays in this silent state for the entire session, and closing it fires nothing either.

Fix explanation:

The fix was pretty simple, basically a 1 liner. We adopt the passed interaction range in the delayed path matching what the code already does at the end of incrementOpeners. The first recheck then scans an ~8.5-block box and once it finds the opener it sets openCount = 1 and keeps rescheduling while open. Behavior for normal-range opens is unchanged (the scan predicate still requires hasContainerOpen, and the count is recomputed from live viewers).

@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Aug 4, 2026
@entrapy
entrapy marked this pull request as ready for review August 4, 2026 16:24
@entrapy
entrapy requested a review from a team as a code owner August 4, 2026 16:24
@Warriorrrr

Copy link
Copy Markdown
Member

Why is the whole description of your PR AI generated? Nobody wants to read that

@Lulu13022002

Copy link
Copy Markdown
Contributor

Depends on #14084

@entrapy

entrapy commented Aug 4, 2026

Copy link
Copy Markdown
Author

sorry, was causing issues on my server with some redstone farms, made an ai summary and rewrote it after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

3 participants