mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-24 16:22:06 +01:00
Fix OOB when retrieving blocks outside buildable area
This commit is contained in:
parent
4b78e41ab4
commit
beb430af07
@ -122,6 +122,9 @@ public class DynamicChunk extends Chunk {
|
||||
|
||||
@Override
|
||||
public @Nullable Block getBlock(int x, int y, int z, @NotNull Condition condition) {
|
||||
if (y < minSection * CHUNK_SECTION_SIZE || y >= maxSection * CHUNK_SECTION_SIZE)
|
||||
return Block.AIR; // Out of bounds
|
||||
|
||||
// Verify if the block object is present
|
||||
if (condition != Condition.TYPE) {
|
||||
final Block entry = !entries.isEmpty() ?
|
||||
|
Loading…
Reference in New Issue
Block a user