# winsmp/fastfoliaworldedit architecture

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

- Interactive diagram: https://gitdiagram.com/winsmp/fastfoliaworldedit
- Repository: https://github.com/winsmp/fastfoliaworldedit

## Overview

FastFoliaWorldEdit is a Paper/Folia Minecraft editing plugin. A player marks two world bounds with an action item, then invokes commands to count or replace matching blocks; replacement plans are scheduled per chunk, applied to the world, and recorded for undo/redo. Filtering, weighted material parsing, chunk regeneration, and progress reporting are separate branches. The README is only a template, so this map is based on the sampled Kotlin runtime sources; unsampled resource configuration is not expanded.

Main entry points: [`src/main/kotlin/org/winlogon/ffwe/FfweCommand.kt`](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/FfweCommand.kt) (FFWE Commands), [`src/main/kotlin/org/winlogon/ffwe/BlockReplacer.kt`](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockReplacer.kt) (Block Replacer), [`src/main/kotlin/org/winlogon/ffwe/BlockCounter.kt`](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockCounter.kt) (Block Counter), [`src/main/kotlin/org/winlogon/ffwe/HistoryManager.kt`](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/HistoryManager.kt) (History Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Plugin Runtime"]
  node_plugin["Plugin Lifecycle<br/>[FfwePlugin.kt]"]
  node_command["FFWE Commands<br/>[FfweCommand.kt]"]
  node_bound_listener["Bound Listener<br/>[BoundListener.kt]"]
end

subgraph group_selection["Selection Filtering"]
  node_filter_argument["Filter Arguments"]
  node_filter_registry["Filter Registry"]
  node_block_filters["Block Filters<br/>[BlockFilter.kt]"]
  node_region["Region Bounds<br/>[Region.kt]"]
end

subgraph group_operations["World Operations"]
  node_folia_scheduler["Folia Scheduler"]
  node_replacer["Block Replacer<br/>[BlockReplacer.kt]"]
  node_counter["Block Counter<br/>[BlockCounter.kt]"]
  node_coord_packer["Coordinate Packing<br/>[CoordPacker.kt]"]
end

subgraph group_state["History Integration"]
  node_world[("Minecraft World")]
  node_history["History Manager<br/>[HistoryManager.kt]"]
  node_region_files[("Region Files")]
end

node_player(("Player"))
node_paper_server["Paper Server"]

node_paper_server -->|"enables"| node_plugin
node_plugin -->|"registers commands"| node_command
node_plugin -->|"registers events"| node_bound_listener
node_player -->|"selects bounds"| node_bound_listener
node_bound_listener -->|"reports bounds"| node_player
node_player -->|"runs commands"| node_command
node_command -->|"reads bounds"| node_bound_listener
node_command -->|"converts filters"| node_filter_argument
node_filter_argument -->|"resolves names"| node_filter_registry
node_filter_argument -->|"creates filters"| node_block_filters
node_command -->|"parses replacements"| node_replacer
node_command -->|"plans changes"| node_replacer
node_replacer -->|"normalizes bounds"| node_region
node_replacer -->|"matches blocks"| node_block_filters
node_replacer -->|"schedules chunks"| node_folia_scheduler
node_replacer -->|"writes blocks"| node_world
node_replacer -->|"packs coordinates"| node_coord_packer
node_command -->|"counts blocks"| node_counter
node_counter -->|"matches blocks"| node_block_filters
node_counter -->|"normalizes bounds"| node_region
node_counter -->|"schedules chunks"| node_folia_scheduler
node_counter -->|"reads blocks"| node_world
node_command -->|"records changes"| node_history
node_command -->|"undoes changes"| node_history
node_command -->|"redoes changes"| node_history
node_history -->|"unpacks coordinates"| node_coord_packer
node_history -->|"restores blocks"| node_world
node_command -->|"reports progress"| node_player
node_command -->|"reports results"| node_player
node_command -.->|"regenerates chunks"| node_replacer
node_replacer -.->|"deletes region files"| node_region_files

click node_plugin "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/FfwePlugin.kt"
click node_command "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/FfweCommand.kt"
click node_bound_listener "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BoundListener.kt"
click node_filter_argument "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockFilterArgument.kt"
click node_filter_registry "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockFilterRegistry.kt"
click node_block_filters "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockFilter.kt"
click node_region "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/Region.kt"
click node_replacer "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockReplacer.kt"
click node_counter "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockCounter.kt"
click node_coord_packer "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/CoordPacker.kt"
click node_history "https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/HistoryManager.kt"

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_plugin,node_command,node_bound_listener toneBlue
class node_filter_argument,node_filter_registry,node_block_filters,node_region toneAmber
class node_folia_scheduler,node_replacer,node_counter,node_coord_packer,node_paper_server toneMint
class node_world,node_history,node_region_files toneRose
class node_player toneIndigo
```

## Components

### Plugin Runtime

- [Plugin Lifecycle](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/FfwePlugin.kt): `src/main/kotlin/org/winlogon/ffwe/FfwePlugin.kt`
- [FFWE Commands](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/FfweCommand.kt): `src/main/kotlin/org/winlogon/ffwe/FfweCommand.kt`
- [Bound Listener](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BoundListener.kt): `src/main/kotlin/org/winlogon/ffwe/BoundListener.kt`

### Selection Filtering

- [Filter Arguments](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockFilterArgument.kt): `src/main/kotlin/org/winlogon/ffwe/BlockFilterArgument.kt`
- [Filter Registry](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockFilterRegistry.kt): `src/main/kotlin/org/winlogon/ffwe/BlockFilterRegistry.kt`
- [Block Filters](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockFilter.kt): `src/main/kotlin/org/winlogon/ffwe/BlockFilter.kt`
- [Region Bounds](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/Region.kt): `src/main/kotlin/org/winlogon/ffwe/Region.kt`

### World Operations

- **Folia Scheduler**
- [Block Replacer](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockReplacer.kt): `src/main/kotlin/org/winlogon/ffwe/BlockReplacer.kt`
- [Block Counter](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/BlockCounter.kt): `src/main/kotlin/org/winlogon/ffwe/BlockCounter.kt`
- [Coordinate Packing](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/CoordPacker.kt): `src/main/kotlin/org/winlogon/ffwe/CoordPacker.kt`

### History Integration

- **Minecraft World**
- [History Manager](https://github.com/winsmp/fastfoliaworldedit/blob/main/src/main/kotlin/org/winlogon/ffwe/HistoryManager.kt): `src/main/kotlin/org/winlogon/ffwe/HistoryManager.kt`
- **Region Files**

### Other components

- **Player**
- **Paper Server**

## Connections

- Paper Server → Plugin Lifecycle: enables
- Plugin Lifecycle → FFWE Commands: registers commands
- Plugin Lifecycle → Bound Listener: registers events
- Player → Bound Listener: selects bounds
- Bound Listener → Player: reports bounds
- Player → FFWE Commands: runs commands
- FFWE Commands → Bound Listener: reads bounds
- FFWE Commands → Filter Arguments: converts filters
- Filter Arguments → Filter Registry: resolves names
- Filter Arguments → Block Filters: creates filters
- FFWE Commands → Block Replacer: parses replacements
- FFWE Commands → Block Replacer: plans changes
- Block Replacer → Region Bounds: normalizes bounds
- Block Replacer → Block Filters: matches blocks
- Block Replacer → Folia Scheduler: schedules chunks
- Block Replacer → Minecraft World: writes blocks
- Block Replacer → Coordinate Packing: packs coordinates
- FFWE Commands → Block Counter: counts blocks
- Block Counter → Block Filters: matches blocks
- Block Counter → Region Bounds: normalizes bounds
- Block Counter → Folia Scheduler: schedules chunks
- Block Counter → Minecraft World: reads blocks
- FFWE Commands → History Manager: records changes
- FFWE Commands → History Manager: undoes changes
- FFWE Commands → History Manager: redoes changes
- History Manager → Coordinate Packing: unpacks coordinates
- History Manager → Minecraft World: restores blocks
- FFWE Commands → Player: reports progress
- FFWE Commands → Player: reports results
- FFWE Commands → Block Replacer: regenerates chunks
- Block Replacer → Region Files: deletes region files
