diff --git a/src/main/java/cz/trailsthroughshadows/api/table/schematic/part/model/PartDTO.java b/src/main/java/cz/trailsthroughshadows/api/table/schematic/part/model/PartDTO.java index 3363b3a..a299df6 100644 --- a/src/main/java/cz/trailsthroughshadows/api/table/schematic/part/model/PartDTO.java +++ b/src/main/java/cz/trailsthroughshadows/api/table/schematic/part/model/PartDTO.java @@ -100,15 +100,20 @@ public void validateInner(ValidationConfig validationConfig) { int diffS = sStats.getMax() - sStats.getMin() - 1; String widthError = "Part must not be wider than %d hexes!".formatted(hexGrid.getMaxWidth()); + List coords = new ArrayList<>(); if (diffQ > hexGrid.getMaxWidth()) { - errors.add(new ValidationError(getValidableClass(), "qCoord", diffQ, widthError)); + coords.add("qCoord"); } if (diffR > hexGrid.getMaxWidth()) { - errors.add(new ValidationError(getValidableClass(), "rCoord", diffR, widthError)); + coords.add("rCoord"); } if (diffS > hexGrid.getMaxWidth()) { - errors.add(new ValidationError(getValidableClass(), "sCoord", diffS, widthError)); + coords.add("sCoord"); + } + + if (!coords.isEmpty()) { + errors.add(new ValidationError(getValidableClass(), "hexes", coords, widthError)); } // no hexes can be on the same position