mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-07 03:10:19 +01:00
Add Vec#apply
This commit is contained in:
parent
5a01c041cf
commit
ab9e16dfe7
@ -3,6 +3,8 @@ package net.minestom.server.utils.incubator;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public interface Vec {
|
||||
|
||||
Vec ZERO = new VecImpl();
|
||||
@ -75,6 +77,11 @@ public interface Vec {
|
||||
return with(Math.max(x(), vec.x()), Math.max(y(), vec.y()), Math.max(z(), vec.z()));
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
default Vec apply(@NotNull UnaryOperator<@NotNull Vec> operator) {
|
||||
return operator.apply(this);
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
double x();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user