Add experimental Point#sameBlock

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-10-11 11:08:35 +02:00
parent eca9b5e32d
commit 5c2ab68a0a

View File

@ -255,4 +255,17 @@ public interface Point {
default boolean sameChunk(@NotNull Point point) {
return chunkX() == point.chunkX() && chunkZ() == point.chunkZ();
}
/**
* Gets if two points are in the same chunk.
*
* @param point the point to compare two
* @return true if 'this' is in the same chunk as {@code point}
*/
@ApiStatus.Experimental
default boolean sameBlock(@NotNull Point point) {
return blockX() == point.blockX() &&
blockY() == point.blockY() &&
blockZ() == point.blockZ();
}
}