Flood fill method causes stackoverflow error (Bukkit API)

my code public Set<Chunk> floodSearch(int x, int z, FactionData colour) { Set<Chunk> toClaim = new HashSet<>(); if ((instance.getChunkManager().getFactionDataByChunk(Bukkit.getServer().getWorld(Config.FACTION_WORLD.getData().toString()).getChunkAt(x, z)) == null) && (toClaim.size() <= (int) Config.MAX_FILL_SIZE.getData())) { //FIRST LOOK IF THE CENTER CHUNK IS EVEN CLAIMED OR NOT, IF IT toClaim.add(Bukkit.getWorld(Config.FACTION_WORLD.getData().toString()).getChunkAt(x, z)); // NOW SEARCH FOR THE NEIGHBOURS floodSearch(x, z + 1, colour); // north…

Details