Skip to content

Resourcepack callbacks - #1892

Open
WouterGritter wants to merge 3 commits into
dev/4.0.0from
resourcepack-callbacks
Open

WouterGritter wants to merge 3 commits into
dev/4.0.0from
resourcepack-callbacks

Conversation

@WouterGritter

Copy link
Copy Markdown
Member

Fixes #1369. Adventure ResourcePackCallbacks passed through Player#sendResourcePacks(ResourcePackRequest) were never called.

Based on #1809, which was closed after its branch was deleted, and GemstoneGG#924 (the same change), plus these fixes:

  • Crash on clients older than 1.20.3 (ported from Fix resourcepack callback NPE GemstoneGG/Velocity-CTD#946): these clients don't send a pack UUID, so a null key reached the ConcurrentHashMap and every resource pack response threw an NPE. Callbacks are now looked up by the queued pack's ID.
  • Callbacks were dropped on clear: clearAppliedResourcePacks() wiped them, so packs still pending during a 1.20.2 server switch, a backend clear, or Player#clearResourcePacks never got their terminal status. Callbacks are now only removed when a pack reaches a terminal status.
  • Out-of-order callbacks: they ran on the common ForkJoinPool, so one pack's ACCEPTED, DOWNLOADED and SUCCESSFUL callbacks could run in any order. They now run in order for each player, on Velocity's executor.
  • Event waited on callback: a slow callback delayed PlayerResourcePackStatusEvent and the force-pack kick. Both now fire independently.

Adds PlayerResourcePackStatusEvent.Status#adventureStatus() to the API.

R00tB33rMan and others added 3 commits September 27, 2026 11:54
- Keep callbacks on clearAppliedResourcePacks, so pending packs still get their terminal status
- Run callbacks in order on Velocity's executor instead of the common pool
- Fire the status event independently of the callback
- Log the callback class on failure
- Note that noOp() is a singleton
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.

Resource pack callbacks are not triggered

2 participants