diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/countingwand/Countingwand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/countingwand/Countingwand.java index da0f0796..3d5e6c33 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/countingwand/Countingwand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/countingwand/Countingwand.java @@ -83,8 +83,7 @@ public class Countingwand { + point.getZ() + ColorConfig.OTHER + "] (" - + ColorConfig.HIGHLIGHT - + Countingwand.getAmount(selection.getKey(), selection.getValue()) + + Countingwand.getDimensions(selection.getKey(), selection.getValue()) + ColorConfig.OTHER + ")"); } @@ -94,11 +93,15 @@ public class Countingwand { selections.remove(p); } - public int getAmount(final Point point1, final Point point2) { + public String getDimensions(final Point point1, final Point point2) { if (point1 == null || point2 == null) { - return 0; + return ColorConfig.HIGHLIGHT + "0" + ColorConfig.OTHER + "," + ColorConfig.HIGHLIGHT + "0" + ColorConfig.OTHER + "," + ColorConfig.HIGHLIGHT + "0"; } + return ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getX() - point2.getX()) + 1) + ColorConfig.OTHER + ", " + ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getY() - point2.getY()) + 1) + ColorConfig.OTHER + ", " +ColorConfig.HIGHLIGHT + "" + (Math.abs(point1.getZ() - point2.getZ()) + 1) + ColorConfig.OTHER; + } + + public int getAmount(final Point point1, final Point point2) { return (Math.abs(point1.getX() - point2.getX()) + 1) * (Math.abs(point1.getY() - point2.getY()) + 1) * (Math.abs(point1.getZ() - point2.getZ()) + 1); } } \ No newline at end of file