[SPIGOT-1390] CraftChunkData setRegion IllegalArgumentException Created: 01/Jan/16 Updated: 10/Jan/16 Resolved: 03/Jan/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Ryan Bennitt | Assignee: | md_5 |
Resolution: | Fixed | Votes: | 0 |
Labels: | Craftbukkit |
Attachments: |
![]() |
Description |
The setRegion method in CraftChunkData produces IllegalArgumentException for certain inputs, particularly when filling up to the full bounds of a chunk. |
Comments |
Comment by Ryan Bennitt [ 10/Jan/16 ] |
I have access! Created pull request for master. |
Comment by md_5 [ 03/Jan/16 ] |
Please fill in the CLA: http://spigotmc.org/go/cla |
Comment by Ryan Bennitt [ 01/Jan/16 ] |
Attached patch to fix. Error in upper bound calculation for Arrays.fill caused by bitwise-or of x-bits overwriting the lowest z-bit, or z-bits overwriting y-bit due to maximum value being 16 (0x10 is the fifth bit, but x and z only have four bits). Changed from bitwise-or to addition to calculate correct upper bound. Also yMax comparison was failing to fill the top chunk, changed from greater-than-or-equal comparison to greater-than. Created unit tests |