# memoxiiii/bridger architecture

> Architecture diagram of the GitHub repository memoxiiii/bridger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/memoxiiii/bridger
- Repository: https://github.com/memoxiiii/bridger

## Overview

Bridger is a native Java–Bedrock Minecraft structure and world converter, with a CLI for format listing, inspection, conversion, placement, and reports. The principal workflow is CLI request → conversion pipeline → format-specific read and write, with translation and placement where needed. The README documents the supported format pairs and world-placement behavior; sampled pipeline excerpts show Bedrock-world integration, while unsampled conversion branches are represented only where the README establishes them. The desktop shell is currently an empty window, not a conversion UI.

Main entry points: [`src/convert/pipeline.cpp`](https://github.com/memoxiiii/bridger/blob/master/src/convert/pipeline.cpp) (Conversion pipeline), [`src/cli/main.cpp`](https://github.com/memoxiiii/bridger/blob/master/src/cli/main.cpp) (CLI commands), [`src/cli/commands/convert.cpp`](https://github.com/memoxiiii/bridger/blob/master/src/cli/commands/convert.cpp) (Convert command), [`src/cli/commands/info.cpp`](https://github.com/memoxiiii/bridger/blob/master/src/cli/commands/info.cpp) (Info command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line interface"]
  node_cli_main["CLI commands<br/>[main.cpp]"]
  node_cli_convert["Convert command<br/>[convert.cpp]"]
  node_cli_info["Info command<br/>[info.cpp]"]
  node_gui_shell["Desktop shell<br/>[app.cpp]"]
end

subgraph group_convert["Conversion workflow"]
  node_pipeline["Conversion pipeline<br/>[pipeline.cpp]"]
  node_placement["Placement policy<br/>[placement.cpp]"]
end

subgraph group_formats["Format handling"]
  node_format_list["Format catalog<br/>[format.cpp]"]
  node_java_schematics["Java structure formats<br/>[sponge_schem.cpp]"]
  node_java_world["Java world formats<br/>[java_world.cpp]"]
  node_bedrock_structure["Bedrock structure format<br/>[mcstructure.cpp]"]
  node_bedrock_world["Bedrock world format<br/>[bedrock_world.cpp]"]
  node_world_reader["Bedrock world reader"]
  node_world_placement["Existing-world placement"]
end

subgraph group_translate["State translation"]
  node_reports["Conversion reports"]
  node_mapping["Mapping data<br/>[mapping_data.cpp]"]
  node_java_bedrock["Java-to-Bedrock translation<br/>[translator.cpp]"]
  node_bedrock_java["Bedrock-to-Java translation"]
  node_block_entities["Block entity translation"]
  node_translation_tables["Translation tables<br/>[tables.hpp]"]
end

subgraph group_runtime["Core and I/O"]
  node_structure_ir["Structure model<br/>[structure.cpp]"]
  node_nbt["NBT handling<br/>[nbt_view.cpp]"]
end

node_user(("CLI user"))

node_user -->|"invokes"| node_cli_main
node_cli_main -->|"dispatches"| node_cli_convert
node_cli_main -->|"dispatches"| node_cli_info
node_cli_main -->|"lists formats"| node_format_list
node_cli_convert -->|"runs conversion"| node_pipeline
node_cli_info -->|"uses helpers"| node_pipeline
node_pipeline -.->|"reads or writes"| node_java_schematics
node_pipeline -.->|"reads or writes"| node_java_world
node_pipeline -.->|"reads or writes"| node_bedrock_structure
node_pipeline -->|"reads or writes"| node_bedrock_world
node_pipeline -->|"reads world"| node_world_reader
node_pipeline -->|"places structure"| node_world_placement
node_pipeline -.->|"applies options"| node_placement
node_pipeline -.->|"translates states"| node_java_bedrock
node_pipeline -.->|"translates states"| node_bedrock_java
node_pipeline -.->|"translates block entities"| node_block_entities
node_pipeline -.->|"collects issues"| node_reports
node_java_bedrock -.->|"uses mappings"| node_mapping
node_bedrock_java -.->|"uses mappings"| node_mapping
node_block_entities -->|"uses tables"| node_translation_tables
node_java_schematics -.->|"loads structure"| node_structure_ir
node_bedrock_structure -.->|"loads structure"| node_structure_ir
node_bedrock_world -.->|"uses NBT"| node_nbt
node_gui_shell -.->|"opens window"| node_user

click node_cli_main "https://github.com/memoxiiii/bridger/blob/master/src/cli/main.cpp"
click node_cli_convert "https://github.com/memoxiiii/bridger/blob/master/src/cli/commands/convert.cpp"
click node_cli_info "https://github.com/memoxiiii/bridger/blob/master/src/cli/commands/info.cpp"
click node_format_list "https://github.com/memoxiiii/bridger/blob/master/src/formats/format.cpp"
click node_pipeline "https://github.com/memoxiiii/bridger/blob/master/src/convert/pipeline.cpp"
click node_placement "https://github.com/memoxiiii/bridger/blob/master/src/convert/placement.cpp"
click node_reports "https://github.com/memoxiiii/bridger/blob/master/src/translate/conversion_report.cpp"
click node_mapping "https://github.com/memoxiiii/bridger/blob/master/src/translate/mapping_data.cpp"
click node_java_bedrock "https://github.com/memoxiiii/bridger/blob/master/src/translate/translator.cpp"
click node_bedrock_java "https://github.com/memoxiiii/bridger/blob/master/src/translate/reverse_translator.cpp"
click node_block_entities "https://github.com/memoxiiii/bridger/blob/master/src/translate/block_entity_translator.cpp"
click node_translation_tables "https://github.com/memoxiiii/bridger/blob/master/src/translate/tables.hpp"
click node_java_schematics "https://github.com/memoxiiii/bridger/blob/master/src/formats/java/sponge_schem.cpp"
click node_java_world "https://github.com/memoxiiii/bridger/blob/master/src/formats/java/anvil/java_world.cpp"
click node_bedrock_structure "https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcstructure.cpp"
click node_bedrock_world "https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcworld/bedrock_world.cpp"
click node_world_reader "https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcworld/bedrock_world_reader.cpp"
click node_world_placement "https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcworld/place_into_world.cpp"
click node_structure_ir "https://github.com/memoxiiii/bridger/blob/master/src/core/structure.cpp"
click node_nbt "https://github.com/memoxiiii/bridger/blob/master/src/io/nbt/nbt_view.cpp"
click node_gui_shell "https://github.com/memoxiiii/bridger/blob/master/src/app/app.cpp"

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_cli_main,node_cli_convert,node_cli_info,node_gui_shell,node_user toneBlue
class node_pipeline,node_placement toneAmber
class node_format_list,node_java_schematics,node_java_world,node_bedrock_structure,node_bedrock_world,node_world_reader,node_world_placement toneMint
class node_reports,node_mapping,node_java_bedrock,node_bedrock_java,node_block_entities,node_translation_tables toneRose
class node_structure_ir,node_nbt toneIndigo
```

## Components

### Command-line interface

- [CLI commands](https://github.com/memoxiiii/bridger/blob/master/src/cli/main.cpp): `src/cli/main.cpp`
- [Convert command](https://github.com/memoxiiii/bridger/blob/master/src/cli/commands/convert.cpp): `src/cli/commands/convert.cpp`
- [Info command](https://github.com/memoxiiii/bridger/blob/master/src/cli/commands/info.cpp): `src/cli/commands/info.cpp`
- [Desktop shell](https://github.com/memoxiiii/bridger/blob/master/src/app/app.cpp): `src/app/app.cpp`

### Conversion workflow

- [Conversion pipeline](https://github.com/memoxiiii/bridger/blob/master/src/convert/pipeline.cpp): `src/convert/pipeline.cpp`
- [Placement policy](https://github.com/memoxiiii/bridger/blob/master/src/convert/placement.cpp): `src/convert/placement.cpp`

### Format handling

- [Format catalog](https://github.com/memoxiiii/bridger/blob/master/src/formats/format.cpp): `src/formats/format.cpp`
- [Java structure formats](https://github.com/memoxiiii/bridger/blob/master/src/formats/java/sponge_schem.cpp): `src/formats/java/sponge_schem.cpp`
- [Java world formats](https://github.com/memoxiiii/bridger/blob/master/src/formats/java/anvil/java_world.cpp): `src/formats/java/anvil/java_world.cpp`
- [Bedrock structure format](https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcstructure.cpp): `src/formats/bedrock/mcstructure.cpp`
- [Bedrock world format](https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcworld/bedrock_world.cpp): `src/formats/bedrock/mcworld/bedrock_world.cpp`
- [Bedrock world reader](https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcworld/bedrock_world_reader.cpp): `src/formats/bedrock/mcworld/bedrock_world_reader.cpp`
- [Existing-world placement](https://github.com/memoxiiii/bridger/blob/master/src/formats/bedrock/mcworld/place_into_world.cpp): `src/formats/bedrock/mcworld/place_into_world.cpp`

### State translation

- [Conversion reports](https://github.com/memoxiiii/bridger/blob/master/src/translate/conversion_report.cpp): `src/translate/conversion_report.cpp`
- [Mapping data](https://github.com/memoxiiii/bridger/blob/master/src/translate/mapping_data.cpp): `src/translate/mapping_data.cpp`
- [Java-to-Bedrock translation](https://github.com/memoxiiii/bridger/blob/master/src/translate/translator.cpp): `src/translate/translator.cpp`
- [Bedrock-to-Java translation](https://github.com/memoxiiii/bridger/blob/master/src/translate/reverse_translator.cpp): `src/translate/reverse_translator.cpp`
- [Block entity translation](https://github.com/memoxiiii/bridger/blob/master/src/translate/block_entity_translator.cpp): `src/translate/block_entity_translator.cpp`
- [Translation tables](https://github.com/memoxiiii/bridger/blob/master/src/translate/tables.hpp): `src/translate/tables.hpp`

### Core and I/O

- [Structure model](https://github.com/memoxiiii/bridger/blob/master/src/core/structure.cpp): `src/core/structure.cpp`
- [NBT handling](https://github.com/memoxiiii/bridger/blob/master/src/io/nbt/nbt_view.cpp): `src/io/nbt/nbt_view.cpp`

### Other components

- **CLI user**

## Connections

- CLI user → CLI commands: invokes (evidence: `README.md`)
- CLI commands → Convert command: dispatches (evidence: `src/cli/main.cpp`)
- CLI commands → Info command: dispatches (evidence: `src/cli/main.cpp`)
- CLI commands → Format catalog: lists formats (evidence: `src/cli/main.cpp`)
- Convert command → Conversion pipeline: runs conversion (evidence: `src/cli/commands/convert.cpp`)
- Info command → Conversion pipeline: uses helpers (evidence: `src/cli/commands/info.cpp`)
- Conversion pipeline → Java structure formats: reads or writes (evidence: `README.md`)
- Conversion pipeline → Java world formats: reads or writes (evidence: `README.md`)
- Conversion pipeline → Bedrock structure format: reads or writes (evidence: `README.md`)
- Conversion pipeline → Bedrock world format: reads or writes (evidence: `src/convert/pipeline.cpp`)
- Conversion pipeline → Bedrock world reader: reads world (evidence: `src/convert/pipeline.cpp`)
- Conversion pipeline → Existing-world placement: places structure (evidence: `src/convert/pipeline.cpp`)
- Conversion pipeline → Placement policy: applies options
- Conversion pipeline → Java-to-Bedrock translation: translates states
- Conversion pipeline → Bedrock-to-Java translation: translates states
- Conversion pipeline → Block entity translation: translates block entities
- Conversion pipeline → Conversion reports: collects issues
- Java-to-Bedrock translation → Mapping data: uses mappings
- Bedrock-to-Java translation → Mapping data: uses mappings
- Block entity translation → Translation tables: uses tables (evidence: `src/translate/block_entity_translator.cpp`)
- Java structure formats → Structure model: loads structure (evidence: `README.md`)
- Bedrock structure format → Structure model: loads structure (evidence: `README.md`)
- Bedrock world format → NBT handling: uses NBT
- Desktop shell → CLI user: opens window (evidence: `src/app/app.cpp`)
