Skip to content

Architecture Overview

Overall Architecture Diagram

mermaid
graph TB
    subgraph Runtime["Runtime Environment"]
        Server["Spigot 1.21+"]
    end

    subgraph Infra["Infrastructure Layer"]
        CoreLib["EmakiCoreLib<br/>Action / GUI / ItemSource / Assembly<br/>Structured Presentation / PDC / YAML / Economy"]
    end

    subgraph Business["Business Plugin Layer"]
        Attribute["EmakiAttribute<br/>Attributes / Combat / Damage Pipeline"]
        Forge["EmakiForge<br/>Forging / Recipes / Editor"]
        Strengthen["EmakiStrengthen<br/>Strengthening / Star Levels / Attempt Flow"]
        Gem["EmakiGem<br/>Gems / Socket Opening / Inlaying / Upgrading"]
        Cooking["EmakiCooking<br/>Four-Station Cooking / World Station State"]
        Skills["EmakiSkills<br/>Active Skills / Triggers / Casting Modes"]
    end

    subgraph Optional["Optional Ecosystem"]
        Mythic["MythicMobs"]
        CraftEngine["CraftEngine"]
        ItemsAdder["ItemsAdder"]
        Nexo["Nexo"]
    end

    Attribute --> CoreLib
    Forge --> CoreLib
    Strengthen --> CoreLib
    Gem --> CoreLib
    Cooking --> CoreLib
    Skills --> CoreLib

    Forge -.->|"softdepend"| Attribute
    Strengthen -.->|"softdepend"| Attribute
    Gem -.->|"softdepend"| Attribute
    Skills -.->|"ServicesManager"| Attribute
    Skills -.->|"Mythic API"| Mythic
    Cooking -.->|"Block Bridge"| CraftEngine
    Cooking -.->|"Block Bridge"| ItemsAdder
    Cooking -.->|"Block Bridge"| Nexo

    CoreLib --> Server

Architecture Explanation

  • EmakiCoreLib is the sole shared infrastructure layer across the entire repository, and serves as the center for "item layer snapshot → rebuild presentation → preserve cross-module state".
  • EmakiAttribute handles attributes, damage, resources, and combat feedback on one hand, while providing optional collaboration boundaries for other modules through PdcAttributeApi and EmakiAttributeBridge on the other.
  • EmakiForge / EmakiStrengthen / EmakiGem all have a hard dependency on CoreLib and collaborate with Attribute via soft dependencies.
  • EmakiCooking follows a "world stations + state persistence + CoreLib item source/action/block bridging" approach.
  • EmakiSkills follows an "unlock source collection + skill slots + triggers + casting modes + MythicMobs/EmakiAttribute bridging" approach, and does not carry the skill effect implementations itself.

Shared Runtime Pattern

Multiple business modules follow a similar startup and reload chain:

  1. Initialize LifecycleCoordinator
  2. Assemble RuntimeComponents
  3. Load language files, configurations, and recipe/data directories
  4. Call BootstrapService to handle versioned files and default resources
  5. Initialize GUI, message services, item sources, bridge services, and business services
  6. Register command routers, event listeners, or service exposures
  7. On reload, re-load configurations and refresh online players' items/GUI sessions/runtime state

Shared Infrastructure Usage Matrix

CoreLib CapabilityAttributeForgeStrengthenCookingGemSkills
GuiServiceIndirectSteamer only
ActionExecutorMinimal
ItemSourceServiceIndirectIndirect
EmakiItemAssemblyServiceName readIndirect
StructuredPresentationRendererPreviewIndirect
MessageService
BootstrapServiceCustom
PdcAttributeGatewayProvides API
EmakiAttributeBridgeProvides service
AdventureSupport / MiniMessages

Cross-Module Contracts

  • EmakiAttribute provides PdcAttributeApi (registered via Bukkit ServicesManager) and exposes EmakiAttributeBridge via ServicesManager. CoreLib's PdcAttributeGateway discovers and proxies this API on the caller side
  • EmakiCoreLib handles namespace layer assembly, removal, and rebuilding
  • EmakiForge / EmakiStrengthen / EmakiGem use their respective source IDs to write snapshots and optional attribute payloads
  • EmakiCooking coordinates world station identification through CustomBlockBridge (CraftEngine / ItemsAdder / Nexo) and ItemSourceService
  • EmakiSkills chains active skill control through trigger dispatching, MythicBridge, and EaBridge

External Ecosystem Dependencies

CoreLib Optional Integrations

Vault · ExcellentEconomy · PlaceholderAPI · MMOItems · ItemsAdder · Nexo · NeigeItems · CraftEngine

CoreLib Bundled Library Declarations

adventure-platform-bukkit · adventure-text-minimessage · adventure-text-serializer-legacy · adventure-text-serializer-plain · exp4j · boosted-yaml

Business Module Collaboration

  • Forge / Strengthen / Gem all have a hard dependency on EmakiCoreLib and a soft dependency on EmakiAttribute
  • Cooking has a hard dependency on EmakiCoreLib and soft dependencies on CraftEngine, ItemsAdder, Nexo
  • Skills has a hard dependency on EmakiCoreLib and soft dependencies on MythicMobs, EmakiAttribute, and PlaceholderAPI

Released under the GPL-3.0 License