Skip to content

Anti Xray bug on certain chunk formats #13834

@Xiao-MoMi

Description

@Xiao-MoMi

Expected behavior

everything works fine

Observed/Actual behavior

Unexpected palette resize in ChunkPacketBlockControllerAntiXray

Image

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.

Image

Then the values passed in this constructor would have two same blockstates

Image

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.

Image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions