mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-09 22:06:09 +01:00
19 lines
424 B
Java
19 lines
424 B
Java
|
package com.jozufozu.flywheel.util;
|
||
|
|
||
|
import javax.annotation.Nullable;
|
||
|
|
||
|
import net.minecraft.world.chunk.Chunk;
|
||
|
import net.minecraft.world.chunk.ChunkSection;
|
||
|
|
||
|
public class ChunkUtil {
|
||
|
|
||
|
public static boolean isValidSection(@Nullable Chunk chunk, int sectionY) {
|
||
|
if (chunk == null) return false;
|
||
|
|
||
|
// TODO: 1.17
|
||
|
ChunkSection[] sections = chunk.getSections();
|
||
|
|
||
|
return sectionY >= 0 && sectionY < sections.length;
|
||
|
}
|
||
|
}
|