# lyriya-928/giant-mushroom-finder architecture

> Architecture diagram of the GitHub repository lyriya-928/giant-mushroom-finder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lyriya-928/giant-mushroom-finder
- Repository: https://github.com/lyriya-928/giant-mushroom-finder

## Overview

Giant Mushroom Island Finder is a desktop and command-line Minecraft Java seed-search application. Users provide a seed, game version, and radius; the native search generates biome samples, detects Mushroom Fields regions, optionally refines estimates, computes region statistics, and returns the largest results. The GUI adds progress and pause/resume/stop controls, while the CLI provides a separate entry point; the product also documents coordinate copying and CSV/JSON export. The graph follows the documented pipeline and sampled JNI/runner code; some GUI, CLI, and native wiring is inferred only where documented.

Main entry points: [`native/mushroom_finder.c`](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c) (Search coordinator), [`src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java`](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java) (Swing GUI), [`src/main/java/dev/sakuhime/mushroomfinder/SearchRunner.java`](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchRunner.java) (Search runner), [`native/tile_search.c`](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/tile_search.c) (Tiled scan and merge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_gui["Swing GUI<br/>[MainFrame.java]"]
  node_cli["Command-line interface<br/>[mushroom_cli.c]"]
  node_export["Copy and export<br/>[MainFrame.java]"]
end

subgraph group_bridge["Java native bridge"]
  node_settings["Search settings"]
  node_runner["Search runner<br/>[SearchRunner.java]"]
  node_nativebridge["JNI bridge<br/>[NativeBridge.java]"]
  node_jni["JNI adapter"]
  node_results["Search results<br/>[SearchResult.java]"]
end

subgraph group_search["Native search"]
  node_core["Search coordinator<br/>[mushroom_finder.c]"]
  node_tiles["Tiled scan and merge<br/>[tile_search.c]"]
  node_mask["Biome sampling and mask<br/>[mushroom_finder.c]"]
  node_components["Connected regions<br/>[mushroom_finder.c]"]
  node_refine["Scale refinement<br/>[mushroom_finder.c]"]
  node_stats["Region statistics and ranking<br/>[mushroom_finder.c]"]
end

subgraph group_generation["Biome generation"]
  node_cubiomes["Cubiomes generator<br/>[generator.c]"]
  node_layers["Biome layers<br/>[layers.c]"]
  node_noise["Biome noise<br/>[biomenoise.c]"]
end

node_user(("User"))

node_user -->|"enters search"| node_gui
node_user -->|"runs search"| node_cli
node_gui -->|"sets parameters"| node_settings
node_gui -->|"starts and controls"| node_runner
node_runner -->|"calls native search"| node_nativebridge
node_nativebridge -->|"dispatches JNI"| node_jni
node_jni -->|"invokes search"| node_core
node_cli -->|"invokes search"| node_core
node_core -->|"scans biome samples"| node_mask
node_core -->|"dispatches tiled scan"| node_tiles
node_mask -->|"requests biome generation"| node_cubiomes
node_tiles -->|"generates tile biomes"| node_cubiomes
node_cubiomes -->|"uses layers"| node_layers
node_cubiomes -->|"uses noise"| node_noise
node_mask -->|"labels samples"| node_components
node_tiles -->|"labels tile samples"| node_components
node_tiles -->|"merges tile regions"| node_components
node_core -->|"optionally refines"| node_refine
node_core -->|"computes and ranks"| node_stats
node_runner -->|"converts returned data"| node_results
node_core -->|"returns result data"| node_runner
node_runner -->|"reports progress and results"| node_gui
node_gui -->|"copies or exports"| node_export

click node_gui "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java"
click node_cli "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_cli.c"
click node_settings "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchSettings.java"
click node_runner "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchRunner.java"
click node_nativebridge "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/NativeBridge.java"
click node_jni "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder_JNI.c"
click node_core "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c"
click node_tiles "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/tile_search.c"
click node_mask "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c"
click node_components "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c"
click node_refine "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c"
click node_stats "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c"
click node_results "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchResult.java"
click node_export "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java"
click node_cubiomes "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/cubiomes/generator.c"
click node_layers "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/cubiomes/layers.c"
click node_noise "https://github.com/lyriya-928/giant-mushroom-finder/blob/main/cubiomes/biomenoise.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gui,node_cli,node_export,node_user toneBlue
class node_settings,node_runner,node_nativebridge,node_jni,node_results toneAmber
class node_core,node_tiles,node_mask,node_components,node_refine,node_stats toneMint
class node_cubiomes,node_layers,node_noise toneRose
```

## Components

### User interfaces

- [Swing GUI](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java): `src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java`
- [Command-line interface](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_cli.c): `native/mushroom_cli.c`
- [Copy and export](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java): `src/main/java/dev/sakuhime/mushroomfinder/MainFrame.java`

### Java native bridge

- [Search settings](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchSettings.java): `src/main/java/dev/sakuhime/mushroomfinder/SearchSettings.java`
- [Search runner](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchRunner.java): `src/main/java/dev/sakuhime/mushroomfinder/SearchRunner.java`
- [JNI bridge](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/NativeBridge.java): `src/main/java/dev/sakuhime/mushroomfinder/NativeBridge.java`
- [JNI adapter](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder_JNI.c): `native/mushroom_finder_JNI.c`
- [Search results](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/src/main/java/dev/sakuhime/mushroomfinder/SearchResult.java): `src/main/java/dev/sakuhime/mushroomfinder/SearchResult.java`

### Native search

- [Search coordinator](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c): `native/mushroom_finder.c`
- [Tiled scan and merge](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/tile_search.c): `native/tile_search.c`
- [Biome sampling and mask](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c): `native/mushroom_finder.c`
- [Connected regions](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c): `native/mushroom_finder.c`
- [Scale refinement](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c): `native/mushroom_finder.c`
- [Region statistics and ranking](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/native/mushroom_finder.c): `native/mushroom_finder.c`

### Biome generation

- [Cubiomes generator](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/cubiomes/generator.c): `cubiomes/generator.c`
- [Biome layers](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/cubiomes/layers.c): `cubiomes/layers.c`
- [Biome noise](https://github.com/lyriya-928/giant-mushroom-finder/blob/main/cubiomes/biomenoise.c): `cubiomes/biomenoise.c`

### Other components

- **User**

## Connections

- User → Swing GUI: enters search
- User → Command-line interface: runs search
- Swing GUI → Search settings: sets parameters
- Swing GUI → Search runner: starts and controls
- Search runner → JNI bridge: calls native search
- JNI bridge → JNI adapter: dispatches JNI
- JNI adapter → Search coordinator: invokes search
- Command-line interface → Search coordinator: invokes search
- Search coordinator → Biome sampling and mask: scans biome samples
- Search coordinator → Tiled scan and merge: dispatches tiled scan
- Biome sampling and mask → Cubiomes generator: requests biome generation
- Tiled scan and merge → Cubiomes generator: generates tile biomes
- Cubiomes generator → Biome layers: uses layers
- Cubiomes generator → Biome noise: uses noise
- Biome sampling and mask → Connected regions: labels samples
- Tiled scan and merge → Connected regions: labels tile samples
- Tiled scan and merge → Connected regions: merges tile regions
- Search coordinator → Scale refinement: optionally refines
- Search coordinator → Region statistics and ranking: computes and ranks
- Search runner → Search results: converts returned data
- Search coordinator → Search runner: returns result data
- Search runner → Swing GUI: reports progress and results
- Swing GUI → Copy and export: copies or exports
