# brian-wuest/mc-prefab architecture

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

- Interactive diagram: https://gitdiagram.com/brian-wuest/mc-prefab
- Repository: https://github.com/brian-wuest/mc-prefab

## Overview

Prefab is a Minecraft mod for placing predefined buildings and other structures, with configurable designs and an in-world preview. A player selects a blueprint, previews and positions its structure, then initiates placement; the shared structure model and platform event handlers implement the build behavior. The tree also shows scanner tools, configuration, networking, and block/item content. Forge, Fabric, and NeoForge provide loader-specific integration around shared code. Several implementation files are unsampled, so uncertain connections are omitted or marked unverified.

Main entry points: [`Shared/src/com/prefab/structures/render/StructureRenderHandler.java`](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/render/StructureRenderHandler.java) (Structure preview), [`Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java`](https://github.com/brian-wuest/mc-prefab/blob/Main/Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java) (Client events), [`Shared/src/com/prefab/structures/items/StructureItem.java`](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/items/StructureItem.java) (Structure blueprints), [`Shared/src/com/prefab/ModRegistryBase.java`](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/ModRegistryBase.java) (Content registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared structure runtime"]
  node_blueprint["Structure blueprints<br/>[StructureItem.java]"]
  node_structure_config["Structure options"]
  node_structure_model["Structure model<br/>[Structure.java]"]
  node_build_handler["Build handler"]
  node_mod_config["Mod configuration"]
end

subgraph group_client["Client interaction"]
  node_preview["Structure preview"]
  node_client_events["Client events<br/>[ClientEvents.java]"]
  node_structure_gui["Structure GUI<br/>[GuiStructure.java]"]
  node_scanner["Structure scanner"]
  node_scanner_config["Scanner settings"]
  node_scanner_gui["Scanner GUI"]
end

subgraph group_content["Mod content"]
  node_blocks["Blocks and items"]
  node_recipes["Crafting conditions"]
end

subgraph group_platform["Loader integration"]
  node_network["Network wrapper"]
  node_payloads["Network payloads"]
  node_server_payloads["Server payload handler"]
  node_client_registry["Client registry"]
  node_mod_registry["Content registry"]
  node_forge_entry["Forge entry point<br/>[Prefab.java]"]
  node_forge_proxy["Forge common proxy<br/>[CommonProxy.java]"]
end

node_player(("Player"))

node_player -->|"selects"| node_blueprint
node_player -->|"previews"| node_preview
node_player -.->|"configures"| node_structure_config
node_blueprint -.->|"opens options"| node_structure_config
node_blueprint -.->|"requests placement"| node_build_handler
node_build_handler -->|"builds from"| node_structure_model
node_preview -->|"renders"| node_structure_model
node_client_events -->|"updates preview"| node_preview
node_client_events -->|"checks selection"| node_structure_gui
node_player -.->|"uses"| node_scanner
node_scanner -.->|"uses settings"| node_scanner_config
node_scanner_gui -.->|"edits"| node_scanner_config
node_preview -->|"reads"| node_scanner_config
node_client_events -->|"sends build request"| node_network
node_network -.->|"transports"| node_payloads
node_server_payloads -->|"handles"| node_payloads
node_server_payloads -->|"loads options"| node_structure_config
node_client_registry -->|"registers"| node_structure_gui
node_client_registry -->|"opens"| node_scanner_gui
node_forge_entry -->|"registers content"| node_mod_registry
node_forge_entry -->|"initializes"| node_forge_proxy
node_mod_registry -->|"registers"| node_blocks
node_player -.->|"uses"| node_blocks
node_mod_registry -.->|"registers recipes"| node_recipes
node_forge_proxy -->|"creates channel"| node_network
node_forge_proxy -->|"loads"| node_mod_config

click node_blueprint "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/items/StructureItem.java"
click node_structure_config "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/config/StructureConfiguration.java"
click node_structure_model "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/base/Structure.java"
click node_build_handler "https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/structures/events/StructureEventHandler.java"
click node_preview "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/render/StructureRenderHandler.java"
click node_client_events "https://github.com/brian-wuest/mc-prefab/blob/Main/Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java"
click node_structure_gui "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/gui/GuiStructure.java"
click node_scanner "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/blocks/BlockStructureScanner.java"
click node_scanner_config "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/config/StructureScannerConfig.java"
click node_scanner_gui "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/gui/screens/GuiStructureScanner.java"
click node_network "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/network/INetworkWrapper.java"
click node_payloads "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/network/payloads/StructurePayload.java"
click node_server_payloads "https://github.com/brian-wuest/mc-prefab/blob/Main/Fabric/src/main/java/com/prefab/fabric/network/ServerPayloadHandler.java"
click node_client_registry "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/ClientModRegistryBase.java"
click node_mod_registry "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/ModRegistryBase.java"
click node_forge_entry "https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/Prefab.java"
click node_forge_proxy "https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/proxy/CommonProxy.java"
click node_blocks "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/blocks/BlockPaperLantern.java"
click node_recipes "https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/crafting/ConditionedShapedRecipe.java"
click node_mod_config "https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/config/ModConfiguration.java"

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_blueprint,node_structure_config,node_structure_model,node_build_handler,node_mod_config toneBlue
class node_preview,node_client_events,node_structure_gui,node_scanner,node_scanner_config,node_scanner_gui toneAmber
class node_blocks,node_recipes toneMint
class node_network,node_payloads,node_server_payloads,node_client_registry,node_mod_registry,node_forge_entry,node_forge_proxy toneRose
class node_player toneIndigo
```

## Components

### Shared structure runtime

- [Structure blueprints](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/items/StructureItem.java): `Shared/src/com/prefab/structures/items/StructureItem.java`
- [Structure options](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/config/StructureConfiguration.java): `Shared/src/com/prefab/structures/config/StructureConfiguration.java`
- [Structure model](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/base/Structure.java): `Shared/src/com/prefab/structures/base/Structure.java`
- [Build handler](https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/structures/events/StructureEventHandler.java): `Forge/src/main/java/com/wuest/prefab/structures/events/StructureEventHandler.java`
- [Mod configuration](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/config/ModConfiguration.java): `Shared/src/com/prefab/config/ModConfiguration.java`

### Client interaction

- [Structure preview](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/render/StructureRenderHandler.java): `Shared/src/com/prefab/structures/render/StructureRenderHandler.java`
- [Client events](https://github.com/brian-wuest/mc-prefab/blob/Main/Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java): `Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java`
- [Structure GUI](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/structures/gui/GuiStructure.java): `Shared/src/com/prefab/structures/gui/GuiStructure.java`
- [Structure scanner](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/blocks/BlockStructureScanner.java): `Shared/src/com/prefab/blocks/BlockStructureScanner.java`
- [Scanner settings](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/config/StructureScannerConfig.java): `Shared/src/com/prefab/config/StructureScannerConfig.java`
- [Scanner GUI](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/gui/screens/GuiStructureScanner.java): `Shared/src/com/prefab/gui/screens/GuiStructureScanner.java`

### Mod content

- [Blocks and items](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/blocks/BlockPaperLantern.java): `Shared/src/com/prefab/blocks/BlockPaperLantern.java`
- [Crafting conditions](https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/crafting/ConditionedShapedRecipe.java): `Forge/src/main/java/com/wuest/prefab/crafting/ConditionedShapedRecipe.java`

### Loader integration

- [Network wrapper](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/network/INetworkWrapper.java): `Shared/src/com/prefab/network/INetworkWrapper.java`
- [Network payloads](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/network/payloads/StructurePayload.java): `Shared/src/com/prefab/network/payloads/StructurePayload.java`
- [Server payload handler](https://github.com/brian-wuest/mc-prefab/blob/Main/Fabric/src/main/java/com/prefab/fabric/network/ServerPayloadHandler.java): `Fabric/src/main/java/com/prefab/fabric/network/ServerPayloadHandler.java`
- [Client registry](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/ClientModRegistryBase.java): `Shared/src/com/prefab/ClientModRegistryBase.java`
- [Content registry](https://github.com/brian-wuest/mc-prefab/blob/Main/Shared/src/com/prefab/ModRegistryBase.java): `Shared/src/com/prefab/ModRegistryBase.java`
- [Forge entry point](https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/Prefab.java): `Forge/src/main/java/com/wuest/prefab/Prefab.java`
- [Forge common proxy](https://github.com/brian-wuest/mc-prefab/blob/Main/Forge/src/main/java/com/wuest/prefab/proxy/CommonProxy.java): `Forge/src/main/java/com/wuest/prefab/proxy/CommonProxy.java`

### Other components

- **Player**

## Connections

- Player → Structure blueprints: selects (evidence: `README.md`)
- Player → Structure preview: previews (evidence: `README.md`)
- Player → Structure options: configures
- Structure blueprints → Structure options: opens options (evidence: `Shared/src/com/prefab/structures/config/StructureConfiguration.java`)
- Structure blueprints → Build handler: requests placement
- Build handler → Structure model: builds from (evidence: `Forge/src/main/java/com/wuest/prefab/structures/events/StructureEventHandler.java`)
- Structure preview → Structure model: renders (evidence: `Shared/src/com/prefab/structures/render/StructureRenderHandler.java`)
- Client events → Structure preview: updates preview (evidence: `Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java`)
- Client events → Structure GUI: checks selection (evidence: `Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java`)
- Player → Structure scanner: uses
- Structure scanner → Scanner settings: uses settings
- Scanner GUI → Scanner settings: edits
- Structure preview → Scanner settings: reads (evidence: `Shared/src/com/prefab/structures/render/StructureRenderHandler.java`)
- Client events → Network wrapper: sends build request (evidence: `Fabric/src/main/java/com/prefab/fabric/events/ClientEvents.java`)
- Network wrapper → Network payloads: transports
- Server payload handler → Network payloads: handles (evidence: `Fabric/src/main/java/com/prefab/fabric/network/ServerPayloadHandler.java`)
- Server payload handler → Structure options: loads options (evidence: `Fabric/src/main/java/com/prefab/fabric/network/ServerPayloadHandler.java`)
- Client registry → Structure GUI: registers (evidence: `Shared/src/com/prefab/ClientModRegistryBase.java`)
- Client registry → Scanner GUI: opens (evidence: `Shared/src/com/prefab/ClientModRegistryBase.java`)
- Forge entry point → Content registry: registers content (evidence: `Forge/src/main/java/com/wuest/prefab/Prefab.java`)
- Forge entry point → Forge common proxy: initializes (evidence: `Forge/src/main/java/com/wuest/prefab/Prefab.java`)
- Content registry → Blocks and items: registers (evidence: `Shared/src/com/prefab/ModRegistryBase.java`)
- Player → Blocks and items: uses
- Content registry → Crafting conditions: registers recipes
- Forge common proxy → Network wrapper: creates channel (evidence: `Forge/src/main/java/com/wuest/prefab/proxy/CommonProxy.java`)
- Forge common proxy → Mod configuration: loads (evidence: `Forge/src/main/java/com/wuest/prefab/proxy/CommonProxy.java`)
