Add block position conversion

This commit is contained in:
TheMode 2021-06-29 00:08:56 +02:00
parent 602472fc65
commit 43ac1c53e3

View File

@ -87,6 +87,13 @@ public interface Vec {
return new Pos(x(), y(), z());
}
default @NotNull Vec asBlockPosition() {
final int castedY = (int) y();
return with((int) Math.floor(x()),
(y() == castedY) ? castedY : castedY + 1,
(int) Math.floor(z()));
}
@Contract(pure = true)
double x();