From 10d6d2bb2ed57414f18f1cf2f0b5b0441770d216 Mon Sep 17 00:00:00 2001 From: mworzala Date: Sat, 4 Jan 2025 11:37:21 -0500 Subject: [PATCH] Revert "Fixed boundingBox.withOffset() (#2488)" This reverts commit 18d6e0c6d62f11cd0c7fa4accde0e1ced41d8c3e, it was previously a breaking change that did not make a lot of sense, and broke other methods. --- src/main/java/net/minestom/server/collision/BoundingBox.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/collision/BoundingBox.java b/src/main/java/net/minestom/server/collision/BoundingBox.java index b68383401..41120b58f 100644 --- a/src/main/java/net/minestom/server/collision/BoundingBox.java +++ b/src/main/java/net/minestom/server/collision/BoundingBox.java @@ -21,11 +21,11 @@ public record BoundingBox(Vec relativeStart, Vec relativeEnd) implements Shape { final static BoundingBox ZERO = new BoundingBox(Vec.ZERO, Vec.ZERO); public BoundingBox(double width, double height, double depth, Point offset) { - this(new Vec(-width / 2.0, 0.0, -depth / 2.0).add(offset), new Vec(width / 2.0, height, depth / 2.0).add(offset)); + this(Vec.fromPoint(offset), new Vec(width, height, depth).add(offset)); } public BoundingBox(double width, double height, double depth) { - this(width, height, depth, Vec.ZERO); + this(width, height, depth, new Vec(-width / 2, 0, -depth / 2)); } @Override