From 45ab550d06ae5277918d5c41bce3fac74ff1fea8 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 14 Aug 2023 02:10:59 +0200 Subject: [PATCH] Ability to get min and max of AABBBlock --- .../lib/paper/geometry/blocks/AABBBlock.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/geometry/blocks/AABBBlock.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/geometry/blocks/AABBBlock.java index fc5bc67..6077adb 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/geometry/blocks/AABBBlock.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/geometry/blocks/AABBBlock.java @@ -74,6 +74,22 @@ public class AABBBlock implements BlockSet, Cloneable { return this; } + public Vector getMin() { + return pos1.clone(); + } + + public Vector getMax() { + return pos2.clone(); + } + + public BlockVector getMinBlock() { + return pos1.toBlockVector(); + } + + public BlockVector getMaxBlock() { + return pos2.clone().add(new Vector(-1, -1, -1)).toBlockVector(); + } + public AABBBlock shift(int x, int y, int z) { return new AABBBlock(this, x, y, z); }