Flywheel/src/main/java/com/jozufozu/flywheel/util/ChunkUtil.java

19 lines
424 B
Java
Raw Normal View History

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;
}
}