# juancarloscp52/bedrockify architecture

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

- Interactive diagram: https://gitdiagram.com/juancarloscp52/bedrockify
- Repository: https://github.com/juancarloscp52/bedrockify

## Overview

##### Project Type and Purpose
- This is a mod project built for Minecraft using Fabric (or Quilt) mod loaders.
- Its purpose is to enhance the Java Edition with features found in Bedrock Edition, such as enhanced loading screens, custom animations, dynamic HUDs, unique world generation tweaks, and more.
- The README explains various features available to the user while the source code and mixin packages reveal that the mod extensively modifies both client and server behavior using mixins and custom data generation.

##### Code Structure
- Main Codebase: The bulk of mod logic is found in the "src/main/java/me/juancarloscp52/bedrockify" package. This package is split into sub-packages:
- The root contains the main mod entry point (BedrockIfy.java) and settings management classes.
- The "client" folder handles client-specific functionality (UI components, GUI overlays, client feature implementations, etc.).
- The "common" folder contains logic that applies to both sides, such as shared block behavior, world generation tweaks, recipe handling, and payload features.
- Mixins: There are extensive mixin packages for client, common, and feature-specific modifications. They indicate that the project uses the Fabric Mixin system to alter vanilla Minecraft behavior. This is a core architectural pattern here.
- Data and Assets: Under "src/main/resources", files such as assets, data tags, blockstates, models, and language files are present. These represent the mod’s static resources, configuration, and data-driven features.
- Build System: With Gradle build scripts (build.gradle, settings.gradle) and the Gradle wrapper files, the project uses Gradle for compilation, dependency management, and deployment.
- Additional Scripts: Files like recipeReplacer.py, spanishLangGenerator.sh, etc., help automate or manage specific tasks (e.g., recipe or language file generation).

##### Main Components
a. Core Mod Entry Point:
– Represented by BedrockIfy.java and BedrockIfySettings.java.
– This component initializes the mod and configures settings.
b. Client Modules:
– Show a grouping for client-specific functionality, including GUI elements (SettingsGUI, Overlay), rendering features, custom animations (eatingAnimations, idleHandAnimations), and other bedrock shading components.
– Include the client features packages and their corresponding mixin modifications (under src/main/java/me/juancarloscp52/bedrockify/client and mixin/client).
c. Common Modules:
– Include shared logic for both client and server, such as common block definitions, features (Dying Trees, cauldrons, world generation nuances), and payloads.
– Show how these core logic components interact with data generation (datagen) and recipe feature packages.
d. Mixin Layer:
– Group them by purpose: client alterations, common features, and workaround features.
e. Resource and Data Files:
– Indicate that these resources feed into the mod’s behavior (for example, using JSON configuration for recipes or worldgen).
f. Build and Automation:
– Although not part of the runtime architecture, note the Gradle build system and associated scripts that automate building, testing, and packaging the mod.
– Optionally, include external dependencies like Fabric API and references to other recommended mods from the README.

##### Relationships and Interactions
- Mixin layer as interceptors that modify behavior in both client and common.
- Resources/Data layer to both the mod’s logic and data generation modules to show dependency (for instance, world generation tweaks pulling from JSON config files).
- How build scripts (Gradle) interact with the entire codebase by compiling, testing, and packaging.

##### Architectural Patterns and Technologies
- Mixin Pattern: Emphasize how the project uses Mixins to inject behavior into the vanilla game. This is central to the mod’s design.
- Separation of Concerns: Clearly separate client-side customizations from common logic. This ensures that features are modular and maintainable.
- Data-Driven Design: Use data folders (assets and resource JSON files) to drive behavior (e.g., custom recipes, loot tables, and models).
- Technologies/Frameworks: Note that Fabric API (or Quilt) is a key dependency here, along with Gradle for build management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Mod Layer
    subgraph "Core Mod Layer"
        Core1["BedrockIfy.java"]:::core
        Core2["BedrockIfySettings.java"]:::core
    end

    %% Business Logic Layer with Client and Common Modules
    subgraph "Business Logic Layer"
        subgraph "Client Modules"
            ClientGroup["Client Modules"]:::client
            ClientMain["BedrockifyClient.java"]:::client
            SettingsGUI["SettingsGUI.java"]:::client
        end
        subgraph "Common Modules"
            CommonGroup["Common Modules"]:::common
            CommonFeature["DyingTrees.java"]:::common
        end
    end

    %% Mixin Layer
    Mixin["Mixin Layer"]:::mixin

    %% Data Generation Layer
    Datagen["Data Generation: BedrockIfyDatagen.java"]:::datagen

    %% Resources and Data Files
    Resources["Resources: assets & data"]:::resource

    %% Build and Automation Layer
    Build["Build & Automation"]:::build

    %% Connections from Core to Business Logic
    Core1 -->|"initializes"| ClientGroup
    Core1 -->|"initializes"| CommonGroup
    Core2 -->|"configures"| ClientGroup
    Core2 -->|"configures"| CommonGroup

    %% Client Modules implementation details
    ClientGroup -->|"implements"| ClientMain
    ClientGroup -->|"implements"| SettingsGUI

    %% Mixin modifications
    Mixin -->|"modifies"| ClientGroup
    Mixin -->|"modifies"| CommonGroup

    %% Data Generation feeding into Common Modules
    Datagen -->|"feeds"| CommonGroup

    %% Resources supplying data to modules
    Resources -->|"supplies"| ClientGroup
    Resources -->|"supplies"| CommonGroup

    %% Build system builds the entire project components
    Build -->|"builds"| Core1
    Build -->|"builds"| Core2
    Build -->|"builds"| ClientGroup
    Build -->|"builds"| CommonGroup
    Build -->|"builds"| Datagen
    Build -->|"builds"| Resources

    %% Click Events for Component Mapping
    click Core1 "https://github.com/juancarloscp52/bedrockify/blob/1.21.5/src/main/java/me/juancarloscp52/bedrockify/BedrockIfy.java"
    click Core2 "https://github.com/juancarloscp52/bedrockify/blob/1.21.5/src/main/java/me/juancarloscp52/bedrockify/BedrockIfySettings.java"
    click ClientGroup "https://github.com/juancarloscp52/bedrockify/tree/1.21.5/src/main/java/me/juancarloscp52/bedrockify/client"
    click ClientMain "https://github.com/juancarloscp52/bedrockify/blob/1.21.5/src/main/java/me/juancarloscp52/bedrockify/client/BedrockifyClient.java"
    click SettingsGUI "https://github.com/juancarloscp52/bedrockify/blob/1.21.5/src/main/java/me/juancarloscp52/bedrockify/client/gui/SettingsGUI.java"
    click CommonGroup "https://github.com/juancarloscp52/bedrockify/tree/1.21.5/src/main/java/me/juancarloscp52/bedrockify/common"
    click CommonFeature "https://github.com/juancarloscp52/bedrockify/blob/1.21.5/src/main/java/me/juancarloscp52/bedrockify/common/features/worldGeneration/DyingTrees.java"
    click Mixin "https://github.com/juancarloscp52/bedrockify/tree/1.21.5/src/main/java/me/juancarloscp52/bedrockify/mixin"
    click Datagen "https://github.com/juancarloscp52/bedrockify/tree/1.21.5/src/main/java/me/juancarloscp52/bedrockify/datagen"
    click Resources "https://github.com/juancarloscp52/bedrockify/tree/1.21.5/src/main/resources/assets/bedrockify"
    click Build "https://github.com/juancarloscp52/bedrockify/blob/1.21.5/build.gradle"

    %% Styles
    classDef core fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef client fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef common fill:#ffe0b2,stroke:#ef6c00,stroke-width:2px;
    classDef mixin fill:#ffcdd2,stroke:#c62828,stroke-width:2px;
    classDef datagen fill:#d1c4e9,stroke:#8e24aa,stroke-width:2px;
    classDef resource fill:#e0f7fa,stroke:#006064,stroke-width:2px;
    classDef build fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;
```
