Anti Xray bug on certain chunk formats
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
everything works fine
Observed/Actual behavior
Unexpected palette resize in ChunkPacketBlockControllerAntiXray
Steps/models to reproduce
When there are two identical block state in a certain section's palette, such as deepslate and deepslate[axis=y] below. These files might be created by some third party softwares.
Then the values passed in this constructor would have two same blockstates
When presetValue is added as the second-to-last element, the palette size at that point is 32 (containing 31 unique states and 1 duplicate state). When presetValue is added as the last element, the calculation of newBits ignores the duplicate element, causing the set that should have 33 elements to be reduced to 32. As a result, the palette resizing cannot be triggered during chunk loading.
Ultimately, when being processed by ChunkPacketBlockControllerAntiXray, the last element that failed to be added results in No Resize Expected.
Plugin and Datapack List
none
Paper version
1.21.11-DEV-c5a2736
Other
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at ChunkPacketBlockControllerAntiXray and trace the palette resizing calculation described in the report. Reproduce the case with duplicate block states, including deepslate and deepslate[axis=y], and verify that adding the preset value triggers resizing when the palette reaches the relevant size without dropping an element.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100