# enokitoraisu/loadingscreen architecture

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

- Interactive diagram: https://gitdiagram.com/enokitoraisu/loadingscreen
- Repository: https://github.com/enokitoraisu/loadingscreen

## Overview

##### Project Type and Purpose
- Recognize that this is a Minecraft mod specifically built to provide a custom loading screen.
- The project uses Gradle for build and dependency management, and contains mod metadata (mcmod.info, pack.mcmeta) and a mixin configuration (mixins.cls.json) to inject custom behavior into the game.

##### File Structure
- Top-Level Files and Directories:
- Build scripts/files: build.gradle, gradlew, gradlew.bat, gradle/ folder.
- Source code: Located under src/main/java – see the package structure (e.g., me.enokitoraisu.loadingscreen), which likely contains mod entry classes.
- Resources folder: Contains mod metadata and mixin configurations.
- Key Components within the Source Code:
- LoadingScreen.java: Likely contains the logic orchestrating the custom loading screen.
- Example.java: Possibly a sample implementation or helper class.
- mixin/MixinSplashProgress.java: Implements a mixin to interact with or override the default splash screen progress, indicating a clear separation of concerns by intercepting game behavior.

##### README
- The README is brief, indicating that the project’s purpose is to replace or enhance the loading screen behavior with a custom one.
- The screenshot reference suggests there’s a visual demonstration, which may indicate user-facing changes.

a. Main Components to Identify:
- Minecraft Game Environment: Represent this as an external system that the mod interacts with.
- Custom Loading Screen Mod:
- LoadingScreen Module: Include the LoadingScreen.java class which likely serves as the main entry-point or controller.
- Mixin Component: Represent the mixin (MixinSplashProgress.java) that injects into Minecraft’s original splash progress method.
- Example Component: Illustrate the Example.java class (if it serves as a demonstration or auxiliary functionality).
- Mod Configuration and Metadata:
- mcmod.info and pack.mcmeta: These files provide metadata about the mod, useful for initialization and versioning.
- mixins configuration (mixins.cls.json): Defines how and which classes get modified via mixins.
- Build and Dependency Management:
- Gradle Build System: Represent how build.gradle and associated Gradle wrapper files compile and package the mod.

b. Relationships and Interactions:
- Control flow from LoadingScreen.java to both the mixin and example utilities, representing typical mod initialization.
- That the metadata (mcmod.info, pack.mcmeta) and mixin configuration inform the mod loading process at startup.
- Gradle build system as an external process that results in the packaged mod, feeding into the game environment.

c. Architectural Patterns and Design Principles:
- Use of Mixins: Highlight that the project uses method interception and behavioral modification via mixins, a common design in Minecraft modding.
- Modularity: Separate components for core functionality (the loading screen logic) and integration (through mixins) suggest a clear modular design.

d. Relevant Technologies:
- Java as the primary language.
- Gradle for building and dependency management.
- Minecraft modding APIs and mixin libraries to perform runtime code modification.

##### Specific Elements
- Clear labels for each component:
- “Minecraft Game Environment”
- “Custom Loading Screen Mod” with subcomponents such as “LoadingScreen.java”, “MixinSplashProgress.java”, and “Example.java”
- “Mod Metadata & Configurations” (mcmod.info, pack.mcmeta, mixins.cls.json)
- “Gradle Build System”
- Data flow and event handling from Minecraft to mixin components.
- The build process (Gradle) packaging the mod to deploy into the game.
- External systems (Minecraft)
- Core mod components (Java classes)
- Configurations and metadata files.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External System
    MC["Minecraft Game Environment"]:::external

    %% Gradle Build System Subgraph
    subgraph "Gradle Build System"
        GRADLE1["build.gradle"]:::build
        GRADLE2["gradlew"]:::build
        GRADLE3["gradlew.bat"]:::build
        GRADLE4["gradle/"]:::build
    end

    %% Mod Metadata & Configurations Subgraph
    subgraph "Mod Metadata & Configurations"
        METADATA1["mcmod.info"]:::config
        METADATA2["pack.mcmeta"]:::config
        METADATA3["mixins.cls.json"]:::config
    end

    %% Custom Loading Screen Mod Subgraph
    subgraph "Custom Loading Screen Mod"
        LS["LoadingScreen.java"]:::mod
        MIXIN["MixinSplashProgress.java"]:::mod
        EXAMPLE["Example.java"]:::mod
    end

    %% Connections
    %% Gradle builds the mod
    GRADLE1 -->|"builds"| LS
    GRADLE2 -->|"builds"| LS
    GRADLE3 -->|"builds"| LS
    GRADLE4 -->|"builds"| LS

    %% Metadata informs mod configuration
    METADATA1 -->|"configures"| LS
    METADATA2 -->|"configures"| LS
    METADATA3 -->|"configures"| LS

    %% Mod initialization and interactions
    LS -->|"initializes"| MIXIN
    LS -->|"utilizes"| EXAMPLE

    %% Minecraft interacts with mod mixin
    MC -->|"intercepts"| MIXIN

    %% Styling classes
    classDef external fill:#f9d,stroke:#333,stroke-width:2px;
    classDef mod fill:#bbf,stroke:#333,stroke-width:2px;
    classDef config fill:#cfc,stroke:#333,stroke-width:2px;
    classDef build fill:#ffd,stroke:#333,stroke-width:2px;

    %% Click Events for Mod Components
    click LS "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/src/main/java/me/enokitoraisu/loadingscreen/LoadingScreen.java"
    click MIXIN "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/src/main/java/me/enokitoraisu/loadingscreen/mixin/MixinSplashProgress.java"
    click EXAMPLE "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/src/main/java/me/enokitoraisu/loadingscreen/Example.java"

    %% Click Events for Metadata & Configurations
    click METADATA1 "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/src/main/resources/mcmod.info"
    click METADATA2 "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/src/main/resources/pack.mcmeta"
    click METADATA3 "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/src/main/resources/mixins.cls.json"

    %% Click Events for Gradle Build System
    click GRADLE1 "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/build.gradle"
    click GRADLE2 "https://github.com/enokitoraisu/loadingscreen/tree/1.12.2-14.23.5.2860/gradlew"
    click GRADLE3 "https://github.com/enokitoraisu/loadingscreen/blob/1.12.2-14.23.5.2860/gradlew.bat"
    click GRADLE4 "https://github.com/enokitoraisu/loadingscreen/tree/1.12.2-14.23.5.2860/gradle/"
```
