Skip to content

Chunk getBlock method incorrect input checking for y coordinate #10315

@PureCadeMC

Description

@PureCadeMC

Expected behavior

The docs state that Chunk.getBlock(int x, int y, int z) requires a specific range of values for the inputs. For the Y coordinate, this is (world minHeight (inclusive) - world maxHeight (exclusive)).

Expected valid input should be from -64 (inclusive) to 320 (exclusive)

Observed/Actual behavior

Calling Chunk.getBlock(int x, int y, int z) on a y value from -64 to -1 throws an IllegalArgumentException that 'y' is out of range. The error indicates "expected (0-256)".

I have not tested values 256-320.

Steps/models to reproduce

Call Chunk.getBlock(int x, int y, int z) with a y value in the range -61 to -1.

Plugin and Datapack List

N/A

Paper version

1.20.4-450

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolution: awaiting responseAdditional information is required from the issue reportertype: bugSomething doesn't work as it was intended to.

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions