Skip to content

Commit

Permalink
Merge branch 'Minestom:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeinerLP authored May 23, 2024
2 parents ebb242f + 1f07d38 commit e9671a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/net/minestom/server/collision/BoundingBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,12 @@ public boolean equals(Object o) {
default -> null;
};
}

public static @NotNull BoundingBox fromPoints(@NotNull Point a, @NotNull Point b) {
Vec aVec = Vec.fromPoint(a);
Vec min = aVec.min(b);
Vec max = aVec.max(b);
Vec dimensions = max.sub(min);
return new BoundingBox(dimensions.x(), dimensions.y(), dimensions.z(), min);
}
}

0 comments on commit e9671a8

Please sign in to comment.