Add Point#section

This commit is contained in:
themode 2021-12-28 16:28:01 +01:00 committed by TheMode
parent c5728a2df1
commit 48b262fee7

View File

@ -3,6 +3,7 @@ package net.minestom.server.coordinate;
import net.minestom.server.instance.block.BlockFace;
import net.minestom.server.utils.MathUtils;
import net.minestom.server.utils.chunk.ChunkUtils;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
@ -75,6 +76,12 @@ public sealed interface Point permits Vec, Pos {
return ChunkUtils.getChunkCoordinate(x());
}
@Contract(pure = true)
@ApiStatus.Experimental
default int section() {
return ChunkUtils.getChunkCoordinate(y());
}
@Contract(pure = true)
default int chunkZ() {
return ChunkUtils.getChunkCoordinate(z());