mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-09 21:29:08 +01:00
Add experimental Point#sameBlock
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
eca9b5e32d
commit
5c2ab68a0a
@ -255,4 +255,17 @@ public interface Point {
|
|||||||
default boolean sameChunk(@NotNull Point point) {
|
default boolean sameChunk(@NotNull Point point) {
|
||||||
return chunkX() == point.chunkX() && chunkZ() == point.chunkZ();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user