Add Point#isZero

This commit is contained in:
TheMode 2021-07-09 12:42:36 +02:00
parent 95a2805723
commit 0ff69503c5
2 changed files with 5 additions and 1 deletions

View File

@ -172,6 +172,10 @@ public interface Point {
Double.compare(point.z(), z()) == 0;
}
default boolean isZero() {
return x() == 0 && y() == 0 && z() == 0;
}
/**
* Gets if two points are in the same chunk.
*

View File

@ -914,7 +914,7 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
* @return true if velocity is not set to 0
*/
public boolean hasVelocity() {
return !velocity.samePoint(Vec.ZERO);
return !velocity.isZero();
}
/**