From 68a1ea7534a4f7a436e85d6c900fef920e8f8825 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 9 May 2022 19:02:13 +0200 Subject: [PATCH] Add AABBBlock#overlaps methods --- .../main/java/fr/pandacube/lib/paper/util/AABBBlock.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Paper/src/main/java/fr/pandacube/lib/paper/util/AABBBlock.java b/Paper/src/main/java/fr/pandacube/lib/paper/util/AABBBlock.java index 6b7cc4e..0280053 100644 --- a/Paper/src/main/java/fr/pandacube/lib/paper/util/AABBBlock.java +++ b/Paper/src/main/java/fr/pandacube/lib/paper/util/AABBBlock.java @@ -56,6 +56,13 @@ public class AABBBlock implements Iterable { volume = Math.abs(p2x_ - p1x_) * Math.abs(p2x_ - p1x_) * Math.abs(p2x_ - p1x_); } + public boolean overlaps(Entity e) { + return overlaps(e.getBoundingBox()); + } + + public boolean overlaps(BoundingBox bb) { + return asBukkitBoundingBox().overlaps(bb); + } public boolean isInside(Vector v) { return v.isInAABB(pos1, pos2);