public void createHexagons() {
Location center = new Location(Bukkit.getWorld("world"), 0, 0, 0);
int numRows = 10;
int numCols = 10;
for (int row = 0; row < numRows; row++) {
Location hexagonCenter = center.subtract(0, 0, calculateHexagonCoordinates(center).get(0).distance(calculateHexagonCoordinates(center).get(1)) * 0.8659);
double distance = calculateHexagonCoordinates(hexagonCenter).get(0).distance(calculateHexagonCoordinates(hexagonCenter).get(1));
for (int col = 0; col < numCols; col++) {
if (col == 1) {
hexagonCenter.setX(0);
}
if (row%2 == 0) {
if (col == 1) {
hexagonCenter.subtract(distance * 4.5, 0, 0);
} else {
hexagonCenter.subtract(distance * 3.0, 0, 0);
}
} else {
hexagonCenter.subtract(distance * 3.0, 0, 0);
}
hexagons.add(hexagonCenter);
System.out.println("Hexagons -> created hexagon: x:" + Math.round(hexagonCenter.getX()) + ", Z:" + hexagonCenter.getZ());
hexagonDrawer.showHexagon(hexagonCenter);
}
}
}