# shayf0x/spigotwarden architecture

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

- Interactive diagram: https://gitdiagram.com/shayf0x/spigotwarden
- Repository: https://github.com/shayf0x/spigotwarden

## Overview

Spigot Warden is a Gradle plugin that turns a plugin JAR built against Spigot’s remapped Mojang names into a JAR readable by a Spigot server. A project configures the target Minecraft version and output directory; Gradle’s setup task obtains SpecialSource and checks for BuildTools artifacts, generating them when absent. The remap task depends on setup and the ordinary JAR task, then runs SpecialSource in two mapping passes and writes the compatible JAR. The README also documents adding the remapped Spigot dependency. The task wiring and remapping implementation are sampled; the documented dependency setup is not implemented in the sampled plugin code.

Main entry points: [`src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java`](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java) (Plugin Entry Point), [`src/main/java/io/github/shayf0x/spigotwarden/Manager.java`](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/Manager.java) (Artifact Manager), [`src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java`](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java) (Remap JAR Task), [`src/main/java/io/github/shayf0x/spigotwarden/tasks/Setup.java`](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/Setup.java) (Setup Task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin Setup"]
  node_plugin["Plugin Entry Point<br/>[SpigotWarden.java]"]
  node_config["Version and Output"]
end

subgraph group_prep["Prerequisite Artifacts"]
  node_setup["Setup Task<br/>[Setup.java]"]
  node_buildtools_task["BuildTools Task<br/>[BuildTools.java]"]
  node_manager["Artifact Manager<br/>[Manager.java]"]
  node_pathbank["Artifact Paths<br/>[PathBank.java]"]
end

subgraph group_remap["JAR Remapping"]
  node_remap_task["Remap JAR Task<br/>[RemapJar.java]"]
  node_jar_task["Gradle JAR Task<br/>[SpigotWarden.java]"]
  node_specialsource_exec["SpecialSource Process<br/>[RemapJar.java]"]
  node_plugin_jar["Compatible Plugin JAR"]
end

subgraph group_integrations["External Dependencies"]
  node_specialsource["SpecialSource JAR"]
  node_buildtools_service(("BuildTools Download"))
  node_mavenlocal[("Local Maven Artifacts")]
  node_spigot_dependency["Remapped Spigot Library"]
end

node_developer(("Plugin Developer"))
node_gradle(("Gradle Project"))

node_developer -->|"configures"| node_config
node_developer -->|"runs tasks"| node_gradle
node_gradle -->|"applies plugin"| node_plugin
node_plugin -->|"creates extension"| node_config
node_plugin -->|"registers task"| node_setup
node_plugin -->|"registers task"| node_buildtools_task
node_plugin -->|"registers task"| node_remap_task
node_plugin -->|"configures output"| node_jar_task
node_gradle -->|"runs setup"| node_setup
node_gradle -->|"runs buildTools"| node_buildtools_task
node_gradle -->|"runs remapJar"| node_remap_task
node_setup -->|"required before"| node_remap_task
node_remap_task -->|"depends on"| node_jar_task
node_setup -->|"checks and installs"| node_manager
node_buildtools_task -->|"requests generation"| node_manager
node_manager -->|"downloads if absent"| node_specialsource
node_manager -->|"downloads BuildTools"| node_buildtools_service
node_manager -->|"checks artifact paths"| node_pathbank
node_mavenlocal -.->|"stores mapped artifacts"| node_pathbank
node_remap_task -->|"checks SpecialSource"| node_manager
node_remap_task -->|"runs two mapping passes"| node_specialsource_exec
node_specialsource_exec -->|"reads mapping inputs"| node_mavenlocal
node_specialsource_exec -->|"reads built JAR"| node_jar_task
node_specialsource_exec -->|"writes remapped JAR"| node_plugin_jar
node_developer -.->|"adds dependency"| node_spigot_dependency

click node_plugin "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java"
click node_config "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWardenExtension.java"
click node_setup "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/Setup.java"
click node_buildtools_task "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/BuildTools.java"
click node_manager "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/Manager.java"
click node_pathbank "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/PathBank.java"
click node_remap_task "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java"
click node_jar_task "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java"
click node_specialsource_exec "https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.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_plugin,node_config toneBlue
class node_setup,node_buildtools_task,node_manager,node_pathbank toneAmber
class node_remap_task,node_jar_task,node_specialsource_exec,node_plugin_jar toneMint
class node_specialsource,node_buildtools_service,node_mavenlocal,node_spigot_dependency toneRose
class node_developer,node_gradle toneIndigo
```

## Components

### Plugin Setup

- [Plugin Entry Point](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java): `src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java`
- [Version and Output](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWardenExtension.java): `src/main/java/io/github/shayf0x/spigotwarden/SpigotWardenExtension.java`

### Prerequisite Artifacts

- [Setup Task](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/Setup.java): `src/main/java/io/github/shayf0x/spigotwarden/tasks/Setup.java`
- [BuildTools Task](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/BuildTools.java): `src/main/java/io/github/shayf0x/spigotwarden/tasks/BuildTools.java`
- [Artifact Manager](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/Manager.java): `src/main/java/io/github/shayf0x/spigotwarden/Manager.java`
- [Artifact Paths](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/PathBank.java): `src/main/java/io/github/shayf0x/spigotwarden/PathBank.java`

### JAR Remapping

- [Remap JAR Task](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java): `src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java`
- [Gradle JAR Task](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java): `src/main/java/io/github/shayf0x/spigotwarden/SpigotWarden.java`
- [SpecialSource Process](https://github.com/shayf0x/spigotwarden/blob/master/src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java): `src/main/java/io/github/shayf0x/spigotwarden/tasks/RemapJar.java`
- **Compatible Plugin JAR**

### External Dependencies

- **SpecialSource JAR**
- **BuildTools Download**
- **Local Maven Artifacts**
- **Remapped Spigot Library**

### Other components

- **Plugin Developer**
- **Gradle Project**

## Connections

- Plugin Developer → Version and Output: configures
- Plugin Developer → Gradle Project: runs tasks
- Gradle Project → Plugin Entry Point: applies plugin
- Plugin Entry Point → Version and Output: creates extension
- Plugin Entry Point → Setup Task: registers task
- Plugin Entry Point → BuildTools Task: registers task
- Plugin Entry Point → Remap JAR Task: registers task
- Plugin Entry Point → Gradle JAR Task: configures output
- Gradle Project → Setup Task: runs setup
- Gradle Project → BuildTools Task: runs buildTools
- Gradle Project → Remap JAR Task: runs remapJar
- Setup Task → Remap JAR Task: required before
- Remap JAR Task → Gradle JAR Task: depends on
- Setup Task → Artifact Manager: checks and installs
- BuildTools Task → Artifact Manager: requests generation
- Artifact Manager → SpecialSource JAR: downloads if absent
- Artifact Manager → BuildTools Download: downloads BuildTools
- Artifact Manager → Artifact Paths: checks artifact paths
- Local Maven Artifacts → Artifact Paths: stores mapped artifacts
- Remap JAR Task → Artifact Manager: checks SpecialSource
- Remap JAR Task → SpecialSource Process: runs two mapping passes
- SpecialSource Process → Local Maven Artifacts: reads mapping inputs
- SpecialSource Process → Gradle JAR Task: reads built JAR
- SpecialSource Process → Compatible Plugin JAR: writes remapped JAR
- Plugin Developer → Remapped Spigot Library: adds dependency
