Add Pos#withView(Pos)

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2022-02-02 16:42:00 +01:00
parent a2b1148343
commit 81ab4214f2

View File

@ -66,6 +66,11 @@ public record Pos(double x, double y, double z, float yaw, float pitch) implemen
return new Pos(x, y, z, yaw, pitch);
}
@Contract(pure = true)
public @NotNull Pos withView(@NotNull Pos pos) {
return withView(pos.yaw(), pos.pitch());
}
/**
* Sets the yaw and pitch to point
* in the direction of the point.