# cozmycdev/jedcore architecture

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

- Interactive diagram: https://gitdiagram.com/cozmycdev/jedcore
- Repository: https://github.com/cozmycdev/jedcore

## Overview

##### Project’s Type and Purpose
- This is a Java-based plugin for Minecraft (specifically an addon for ProjectKorra) that extends bending abilities. Its purpose is to add, update, and refine bending abilities, along with collision detection, configurable cooldowns, and other enhancements.
- The README confirms the project is maintained as a fork of a previous plugin version and details many ability-specific changes and configuration tweaks.

##### File Structure and Identify Major Components
- Core Package (src/com/jedk1/jedcore):
– Contains the main plugin classes (JedCore.java, JCManager.java, JCMethods.java) that likely serve as the entry and control point.
- Ability Modules:
– Grouped by bending type (airbending, earthbending, firebending, waterbending, avatar, and chiblocking).
– Each ability is encapsulated in its own class (e.g., AirBlade.java, LavaDisc.java, FireBall.java). Also, several abilities have combo subfolders to indicate more complex chaining behavior.
- Collision and Physics:
– The 'collision' package includes classes like AABB.java, Sphere.java, CollisionDetector.java, etc., which likely define how abilities interact physically.
- Event and Listener Handling:
– The 'event' and 'listener' packages handle gameplay events (e.g., PKCommandEvent) along with ability and command listeners.
- Configuration:
– The 'configuration' package (Config.java, JedCoreConfig.java, etc.) manages the plugin’s settings, likely read from a configuration file. The plugin.yml also assists in bootstrapping the plugin.
- Command and Policy Handling:
– The 'command' package (including JedCoreCommand.java and Commands.java) takes care of user interactions and input.
– The 'policies' package (specifically removal policies) indicates the plugin’s design for properly deactivating abilities based on game state changes.
- Utility and Version Adapters:
– The 'util' package provides auxiliary classes (such as MetricsLite, BlockUtil) for miscellaneous functions and handling different Minecraft versions.

##### Components and Relationships
a. Main Plugin Core:
- Inside it show core management classes (JedCore.java, JCManager.java, JCMethods.java).
b. Ability Modules:
- Bending ability group as a separate component (e.g., "Air Bending Abilities", "Earth Bending Abilities", etc.) with sub-components for individual abilities and combos.
c. Event Handling and Listeners:
d. Collision/Physics Engine:
- A “Collision & Physics” block that interacts with the abilities when actions involve collision detection.
e. Command and Policy Handling:
f. Utilities and Version Adaptation:
- A “Utilities & Version Adapters” component that supports compatibility (showing ParticleAdapter, PotionEffectAdapter, etc.) ensuring abilities behave correctly across Minecraft versions.
g. External Integrations:
- A block to represent integration with external systems, such as ProjectKorra and possibly configuration files for spigot and maven (pom.xml) builds.

##### Instructing the Principal Software Engineer
- a. Configuration & Utilities: loaded at startup.
- b. Event & Listener: receives and forwards events to the core management.
- c. Ability Modules: list and organize each bending type (air, water, earth, fire, avatar, chi) with submodules for combos.
- d. Collision/Physics: supporting project-specific collision detection for abilities.
- e. Command Handling: responsible for user commands and administrative operations.
- f. Removal/Policies: handle the lifecycle of abilities and cleanup.
- Use annotations to indicate how configuration options (such as ability-specific options, cooldowns, and visual effects) influence behavior.

## Diagram (Mermaid)

```mermaid
graph TD
    %% External Entities
    MS("Minecraft Server"):::external
    PK("ProjectKorra"):::external

    %% Event & Listener Handling Subgraph
    subgraph "Event & Listener Handling"
        EV("Event Handling"):::event
        LS("Listener Handling"):::event
    end

    %% Main Plugin Core Subgraph
    subgraph "Main Plugin Core"
        JED1("JedCore.java"):::coreSub
        JED2("JCManager.java"):::coreSub
        JED3("JCMethods.java"):::coreSub
    end

    %% Other Core Components
    CONF("Configuration Module"):::config
    ABILITY("Ability Modules"):::ability
    COLL("Collision & Physics Engine"):::collision
    CMD("Command & Policy Handling"):::command
    UTIL("Utilities & Version Adapters"):::utility

    %% Flow Relationships
    MS -->|"triggers"| EV
    EV -->|"forwards"| LS
    LS -->|"activates"| JED1
    EV -->|"commands"| CMD
    PK ---|"integrates"| JED1
    JED1 -->|"loadsConfig"| CONF
    JED1 -->|"executesAbilities"| ABILITY
    JED1 -->|"handlesCommands"| CMD
    JED1 -->|"usesUtilities"| UTIL
    ABILITY -->|"collisionChecks"| COLL

    %% Click Events for Main Plugin Core
    click JED1 "https://github.com/cozmycdev/jedcore/blob/MC-1.20.5/src/com/jedk1/jedcore/JedCore.java"
    click JED2 "https://github.com/cozmycdev/jedcore/blob/MC-1.20.5/src/com/jedk1/jedcore/JCManager.java"
    click JED3 "https://github.com/cozmycdev/jedcore/blob/MC-1.20.5/src/com/jedk1/jedcore/JCMethods.java"

    %% Click Events for Ability Modules
    click ABILITY "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/ability"

    %% Click Events for Collision & Physics Engine
    click COLL "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/collision"

    %% Click Events for Event & Listener Handling
    click EV "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/event"
    click LS "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/listener"

    %% Click Events for Configuration Module
    click CONF "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/configuration"
    click CONF "https://github.com/cozmycdev/jedcore/blob/MC-1.20.5/plugin.yml"

    %% Click Events for Command & Policy Handling
    click CMD "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/command"
    click CMD "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/policies"

    %% Click Events for Utilities & Version Adapters
    click UTIL "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/util"
    click UTIL "https://github.com/cozmycdev/jedcore/tree/MC-1.20.5/src/com/jedk1/jedcore/util/versionadapter"

    %% Styling
    classDef external fill:#C0C0C0,stroke:#333,stroke-width:2px;
    classDef coreSub fill:#87CEEB,stroke:#333,stroke-width:2px;
    classDef event fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef config fill:#FFA07A,stroke:#333,stroke-width:2px;
    classDef ability fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef collision fill:#F0E68C,stroke:#333,stroke-width:2px;
    classDef command fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef utility fill:#DDA0DD,stroke:#333,stroke-width:2px;
```
