When placing a block that emits light at the height limit* (y=319) a server like Paper will save a chunk section with the lighting information. getYRange() should not include chunk sections that can not have blocks and do not have any block data, or there should be a separate function for Y range only including chunk sections with block data.
The chunk with a Y of 20 should be ignored because it is past the build height and has no block data
*This also probably happens when placing a block that emits light at the height min, but I haven't tested it
You can see Eoghanmc22 and I as we were figuring this out here in the Minestom discord server
When placing a block that emits light at the height limit* (y=319) a server like Paper will save a chunk section with the lighting information. getYRange() should not include chunk sections that can not have blocks and do not have any block data, or there should be a separate function for Y range only including chunk sections with block data.
The chunk with a Y of 20 should be ignored because it is past the build height and has no block data
*This also probably happens when placing a block that emits light at the height min, but I haven't tested it