# zhd99/mineminenomi architecture

> Architecture diagram of the GitHub repository zhd99/mineminenomi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhd99/mineminenomi
- Repository: https://github.com/zhd99/mineminenomi

## Overview

##### Main Components
- Core/Initialization – This includes the main mod entry point (e.g. ModMain.java, ForgeSetup.java, ModSetup.java) and the various “init” packages (ModAbilities, ModBlocks, ModItems, ModEntities, etc.) that register and bootstrap the mod’s features.
- Abilities & Capabilities – A large portion of the code is dedicated to the “abilities” subsystem (organized under packages like “abilities”, “api/abilities”, “wypi/abilities”). This module manages the registration, execution, and networking of the 203+ abilities. It handles various types of abilities (active, passive, continuous, chargeable, etc.) and their corresponding events, models, renderers, and network synchronization.
- Entities, Blocks, and Items – The project defines custom blocks (including world gen features, custom machine-like blocks such as cannons, spawners, and dials), custom entities (mobs, animals, pirates, marines, quest givers and objectives), and items (weapons, armors, spawn eggs, consumables). These are organized into separate packages (entities, blocks, items, models, renderers) and have their own JSON data (loot tables, recipes, models, textures).
- Quests and Crew Systems – There is a comprehensive quest/mission subsystem (under quests and objectives packages) and a crew system (using jolly rogers, crew APIs) to drive the mod’s exploration and multiplayer aspects.
- Networking and Data Synchronization – The “packets” packages for client and server (both under “mineminenomi/packets” and “wypi/network/packets”) coordinate data transfer (e.g. synchronization of abilities, quests, and entity states) between the client and server.
- Events and Helpers – An event-driven architecture, typical of Minecraft Forge mods, is clearly used. There are many event listener packages (events, events/abilities, events/devilfruits, etc.) and helper classes (in the “helpers” and “data” packages) to facilitate game logic responses and data management.

##### Relationships and Interactions
- The Core Initialization module (ModMain/ModSetup) loads and registers all submodules at startup. It interacts with the Forge event bus to listen for game lifecycle events.
- Each subsystem (Abilities, Blocks, Entities, Items, Quests, etc.) registers itself via dedicated modules (like ModAbilities, ModEntities, etc.) and then operates by firing and handling events.
- The Abilities subsystem interacts with Entities (for example, applying an ability to a mob), and with the networking layer to synchronize state or trigger visual effects on the client. Data helpers and packet classes bridge these interactions.
- The Renderer and UI modules consume data from the world and entity systems, utilizing networking to keep client views in sync with server state.
- The quest and crew systems are integrated into the core gameplay loop. They update through events (e.g., quest events or crew updates) and rely on configuration and data JSON files for basis.

##### Architectural Patterns and Design Principles
- Modularity and Separation of Concerns: Each major feature (abilities, quests, blocks, etc.) is implemented as its own module/package, enabling easier maintenance and potential extensibility.
- Event-Driven Architecture: Forge’s event bus is used extensively; events drive the interaction between components (like ability activation, state sync, and world generation).
- Client-Server Communication: Dedicated packet classes exist to ensure that client-side rendering and UI stay in sync with server-side game logic.
- API and Abstraction Layers: The mod defines API classes (e.g., in the “api” packages) to abstract ability usage, entity stats, crew information, etc.

##### Relevant Technologies and Frameworks
- Minecraft Forge – The mod framework used to hook into the game engine.
- Gradle – The build system (with Gradle build scripts and wrapper).
- Java – The programming language, following object-oriented design and event-driven principles.
- JSON Data Files – For models, loot tables, recipes, and language localization.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Initialization Layer
    subgraph "Core Initialization"
        ModMain["ModMain (Main Entry)"]:::core
        ForgeSetup["ForgeSetup"]:::core
        ModSetup["ModSetup"]:::core
    end

    %% Gameplay Modules Layer
    subgraph "Gameplay Modules"
        subgraph "Abilities & Capabilities"
            AbilitiesModule["Abilities Module"]:::ability
            AbilitiesAPI["Abilities API"]:::ability
        end
        subgraph "Entities, Blocks & Items"
            Entities["Entities Module"]:::entity
            Blocks["Blocks Module"]:::entity
            Items["Items Module"]:::entity
        end
        subgraph "Quests and Crew Systems"
            QuestEngine["Quest Engine"]:::quest
        end
    end

    %% Communication & Event Handling Layer
    subgraph "Communication & Event Handling"
        subgraph "Networking and Data Sync"
            NetworkPackets["Network Packets"]:::network
        end
        subgraph "Events and Helpers"
            Events["Events Module"]:::events
            Helpers["Helpers Module"]:::events
        end
    end

    %% Rendering and UI Layer
    subgraph "Rendering and UI"
        Renderers["Renderers Module"]:::render
        Screens["Screens UI"]:::render
    end

    %% Connections: Core Initialization registers modules
    ModMain -->|"registers"| AbilitiesModule
    ModMain -->|"registers"| Entities
    ModMain -->|"registers"| Blocks
    ModMain -->|"registers"| Items
    ModMain -->|"registers"| QuestEngine
    ModMain -->|"registers"| NetworkPackets
    ModMain -->|"registers"| Events
    ModMain -->|"registers"| Renderers

    %% Additional Interactions
    AbilitiesModule -->|"affects"| Entities
    AbilitiesModule -->|"syncs"| NetworkPackets
    Events -->|"triggers"| NetworkPackets
    NetworkPackets -->|"updates"| Renderers
    NetworkPackets -->|"updates"| Screens
    Events -->|"notifies"| Renderers
    Events -->|"utilizes"| Helpers

    %% Click Events for Core/Initialization
    click ModMain "https://github.com/zhd99/mineminenomi/blob/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/ModMain.java"
    click ForgeSetup "https://github.com/zhd99/mineminenomi/blob/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/setup/ForgeSetup.java"
    click ModSetup "https://github.com/zhd99/mineminenomi/blob/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/setup/ModSetup.java"

    %% Click Events for Abilities & Capabilities
    click AbilitiesModule "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/abilities"
    click AbilitiesAPI "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/api/abilities"

    %% Click Events for Entities, Blocks, and Items
    click Entities "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/entities"
    click Blocks "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/blocks"
    click Items "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/items"

    %% Click Event for Quests and Crew Systems
    click QuestEngine "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/quests"

    %% Click Event for Networking and Data Synchronization
    click NetworkPackets "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/packets"

    %% Click Events for Events and Helpers
    click Events "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/events"
    click Helpers "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/api/helpers"

    %% Click Events for Rendering and UI
    click Renderers "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/renderers"
    click Screens "https://github.com/zhd99/mineminenomi/tree/1.14.4/src/main/java/xyz/pixelatedw/mineminenomi/screens"

    %% Styles
    classDef core fill:#FFEEAD,stroke:#333,stroke-width:2px;
    classDef ability fill:#B3E5FC,stroke:#333,stroke-width:2px;
    classDef entity fill:#C8E6C9,stroke:#333,stroke-width:2px;
    classDef quest fill:#FFE0B2,stroke:#333,stroke-width:2px;
    classDef network fill:#D1C4E9,stroke:#333,stroke-width:2px;
    classDef events fill:#FFCDD2,stroke:#333,stroke-width:2px;
    classDef render fill:#F8BBD0,stroke:#333,stroke-width:2px;
```
