# presentkim-pm/play-sound-utils architecture

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

- Interactive diagram: https://gitdiagram.com/presentkim-pm/play-sound-utils
- Repository: https://github.com/presentkim-pm/play-sound-utils

## Overview

##### Main Components

a) Core Components:
- PlaySound Class
- VanillaPlaySounds Class
- PocketMine-MP Core (external dependency)
- Minecraft: Bedrock Client (external endpoint)

**┌─────────────────────────────────────────────┐**
- Minecraft: Bedrock Client        │
- ┘
- ▲
- PlaySoundPacket

**┌─────────────────────────────────────────────┐**
- PocketMine-MP Server             │
- ┤
- play-sound-utils Virion           │
- ┌───────────────┐      ┌───────────────┐  │
- PlaySound   │      │VanillaPlaySounds│ │
- ┘      └───────────────┘  │
- ┘

##### Important Details

a) Interface Implementations:
- That PlaySound implements PocketMine's Sound interface
- VanillaPlaySounds as a utility class with static methods

b) Key Methods:
- createPacket()
- sendTo()
- World::addSound() integration

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client ["Minecraft: Bedrock Client"]
        ClientEnd[Client Endpoint]:::client
    end

    subgraph PMMP ["PocketMine-MP Server"]
        subgraph Virion ["play-sound-utils Virion"]
            PlaySound["PlaySound Class"]:::core
            VanillaPlaySounds["VanillaPlaySounds Class"]:::core
            Config["Virion Config"]:::config
            Deps["Package Dependencies"]:::config
        end
        
        PMCore["PocketMine-MP Core"]:::pmmp
    end

    %% Relationships
    PlaySound --> ClientEnd
    VanillaPlaySounds --> PlaySound
    PMCore --> PlaySound
    PlaySound -.-> PMCore

    %% Click Events
    click PlaySound "https://github.com/presentkim-pm/play-sound-utils/blob/main/src/kim/present/utils/playsound/PlaySound.php"
    click VanillaPlaySounds "https://github.com/presentkim-pm/play-sound-utils/blob/main/src/kim/present/utils/playsound/VanillaPlaySounds.php"
    click Config "https://github.com/presentkim-pm/play-sound-utils/blob/main/virion.yml"
    click Deps "https://github.com/presentkim-pm/play-sound-utils/blob/main/composer.json"

    %% Styling
    classDef core fill:#2374e1,stroke:#164b94,color:#fff
    classDef client fill:#666,stroke:#333,color:#fff
    classDef pmmp fill:#95c93d,stroke:#679029,color:#000
    classDef config fill:#f9a825,stroke:#c17900,color:#000

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Client Interface]:::client
        L3["PocketMine-MP"]:::pmmp
        L4[Configuration]:::config
    end
```
