From c8754871737f4429af97ccd1ebd64c390c95498b Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 9 Feb 2022 14:19:00 +0000 Subject: [PATCH] Improve plot getVolume method readability --- Core/src/main/java/com/plotsquared/core/plot/Plot.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index df6c0a74f..300c25ecf 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -1619,9 +1619,8 @@ public class Plot { public double getVolume() { double count = 0; for (CuboidRegion region : getRegions()) { - count += (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * - (region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1) * - (area.getMaxGenHeight() - area.getMinGenHeight() + 1); + // CuboidRegion#getArea is deprecated and we want to ensure use of correct height + count += region.getLength() * region.getWidth() * (area.getMaxGenHeight() - area.getMinGenHeight() + 1); } return count; }