# etianl/trouser-streak architecture

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

- Interactive diagram: https://gitdiagram.com/etianl/trouser-streak
- Repository: https://github.com/etianl/trouser-streak

## Overview

##### Main Components

a) Core Module System:

b) Module Categories (group these in separate containers):
##### Griefing Modules
- Server Manipulation (CrashCommand, LecternCrash, etc.)
- World Manipulation (HandOfGod, Voider+, etc.)
- Duplication Modules (ShulkerDupe, BookAndQuillDupe, etc.)
##### Utility Modules
- Movement (TPFly, FlightAntikick, etc.)
- Building (AutoMountain, TrouserBuild, etc.)
- Detection (BaseFinder, NewerNewChunks, etc.)

c) Command System:
- Connection to Minecraft's chat system

d) Event System:
- Event handlers and their connections to Minecraft's event system
- How events trigger module behaviors

##### Architectural Patterns to Highlight

a) Mixin System:
- Mixins to their target Minecraft classes
- Accessor interfaces

b) Module Management:
- How modules are registered and managed
- Configuration persistence system

##### Key Relationships

- Module → Minecraft Client interaction
- Mixin → Target Class modification
- Command → Chat System integration
- Event System → Module activation flow

##### Implementation Details

a) Data Flow:
- How commands process user input
- Module activation/deactivation flow
- Demonstrate configuration loading/saving

b) Integration Points:
- Meteor Client API connection
- Minecraft base game modification points
- File system interaction for saved data

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Module]:::module
        L2[Core Component]:::core
        L3[Command]:::command
        L4((Event)):::event
        L5[(Data Storage)]:::storage
        L6{{Mixin}}:::mixin
        L7[/API/]:::api
    end

    subgraph Core["Core System"]
        Trouser[Trouser Core]:::core
        click Trouser "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/Trouser.java"
        MeteorAPI[/Meteor Client API/]:::api
        MinecraftAPI[/Minecraft API/]:::api
        Config[(Configuration)]:::storage
    end

    subgraph GriefingModules["Griefing Modules"]
        direction TB
        subgraph ServerManip["Server Manipulation"]
            LecternCrash[LecternCrash]:::griefing
            click LecternCrash "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/LecternCrash.java"
            OPServerKill[OPServerKill]:::griefing
            click OPServerKill "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/OPServerKillModule.java"
        end

        subgraph WorldManip["World Manipulation"]
            HandOfGod[HandOfGod]:::griefing
            click HandOfGod "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/HandOfGod.java"
            VoiderPlus[Voider+]:::griefing
            click VoiderPlus "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/VoiderPlus.java"
        end

        subgraph Duplication["Duplication"]
            ShulkerDupe[ShulkerDupe]:::griefing
            click ShulkerDupe "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/ShulkerDupe.java"
            BookDupe[BookAndQuillDupe]:::griefing
            click BookDupe "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/BookAndQuillDupe.java"
        end
    end

    subgraph UtilityModules["Utility Modules"]
        direction TB
        subgraph Movement
            TPFly[TPFly]:::utility
            click TPFly "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/TPFly.java"
            FlightAntikick[FlightAntikick]:::utility
            click FlightAntikick "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/FlightAntikick.java"
        end

        subgraph Building
            AutoMountain[AutoMountain]:::utility
            click AutoMountain "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/AutoMountain.java"
            TrouserBuild[TrouserBuild]:::utility
            click TrouserBuild "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/TrouserBuild.java"
        end

        subgraph Detection
            BaseFinder[BaseFinder]:::utility
            click BaseFinder "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java"
            NewerNewChunks[NewerNewChunks]:::utility
            click NewerNewChunks "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java"
        end
    end

    subgraph CommandSystem["Command System"]
        Commands[Commands Handler]:::command
        click Commands "https://github.com/etianl/Trouser-Streak/tree/main/src/main/java/pwn/noobs/trouserstreak/commands"
        CrashCommand[CrashCommand]:::command
        click CrashCommand "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/commands/CrashCommand.java"
        WorldInfo[WorldInfoCommand]:::command
        click WorldInfo "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/commands/WorldInfoCommand.java"
    end

    subgraph EventSystem["Event System"]
        EventHandler((Event Handler)):::event
        click EventHandler "https://github.com/etianl/Trouser-Streak/tree/main/src/main/java/pwn/noobs/trouserstreak/events"
        OffGroundSpeed((OffGroundSpeed)):::event
        click OffGroundSpeed "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/events/OffGroundSpeedEvent.java"
    end

    subgraph MixinSystem["Mixin System"]
        Mixins{{Mixin Handler}}:::mixin
        click Mixins "https://github.com/etianl/Trouser-Streak/tree/main/src/main/java/pwn/noobs/trouserstreak/mixin"
        PlayerMixin{{PlayerEntityMixin}}:::mixin
        click PlayerMixin "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/mixin/PlayerEntityMixin.java"
        InteractionMixin{{InteractionManagerMixin}}:::mixin
        click InteractionMixin "https://github.com/etianl/Trouser-Streak/blob/main/src/main/java/pwn/noobs/trouserstreak/mixin/ClientPlayerInteractionManagerMixin.java"
    end

    Trouser --> MeteorAPI
    Trouser --> MinecraftAPI
    Trouser --> Config
    
    GriefingModules --> Trouser
    UtilityModules --> Trouser
    CommandSystem --> Trouser
    EventSystem --> Trouser
    MixinSystem --> MinecraftAPI

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef griefing fill:#e74c3c,stroke:#c0392b,color:white
    classDef utility fill:#2ecc71,stroke:#27ae60,color:white
    classDef command fill:#f1c40f,stroke:#f39c12,color:white
    classDef event fill:#9b59b6,stroke:#8e44ad,color:white
    classDef mixin fill:#e67e22,stroke:#d35400,color:white
    classDef storage fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef api fill:#1abc9c,stroke:#16a085,color:white
    classDef module fill:#34495e,stroke:#2c3e50,color:white
```
