Fix resource pack UUID serialization causing server kick on 1.21+#3842
Fix resource pack UUID serialization causing server kick on 1.21+#3842
Conversation
|
everything is cool |
There was a problem hiding this comment.
Removed the branch — denyResourcePack now unconditionally writes a single packet with uuid included. Done in 708fd6f.
| } | ||
| }) | ||
|
|
||
| function acceptResourcePack () { |
There was a problem hiding this comment.
These branches are also unnecessary
There was a problem hiding this comment.
Removed all feature branching from acceptResourcePack — it now always writes both packets with uuid and hash fields unconditionally (protodef drops fields not in the version's schema). Done in 708fd6f.
|
@copilot since protodef will ignore extraneous fields for versions that don't have them, the feature branching is unnecessary. Feature branching is only needed for fields that have different non-null data types between different versions; using different field names removes this need. You can remove them where applicable for cleanliness (sometimes it's helpful to have comments aside fields to notate what version the field applies to) |
Done in 708fd6f. Removed all feature branching from |
|
merge this immediately! |
Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
…branching Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
…it, add tests
Move latestUUID and latestHash assignments before bot.emit('resourcePack') in
the resource_pack_send handler so they are available when acceptResourcePack or
denyResourcePack is called synchronously from the event. Also add hash field to
denyResourcePack for versions that require it, and add comprehensive tests for
both accept and deny across all supported versions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
708fd6f to
99e2279
Compare
Verifies that acceptResourcePack() and denyResourcePack() send the UUID as a raw string (not a UUID object) in the resource_pack_receive packet, preventing server kicks on 1.21+. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
latestUUIDstorage: store raw bytes (data.uuid) not UUID object, in bothadd_resource_packandresource_pack_sendhandlersdenyResourcePackdouble-write bugacceptResourcePackanddenyResourcePack— protodef ignores extraneous fields so version checks are unnecessarylatestUUIDandlatestHashassignments outside the if/else inresource_pack_sendso both are always storedOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.