# astolfogamer-osrs/chugging-sound architecture

> Architecture diagram of the GitHub repository astolfogamer-osrs/chugging-sound, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/astolfogamer-osrs/chugging-sound
- Repository: https://github.com/astolfogamer-osrs/chugging-sound

## Overview

Chugging Sound is a small RuneLite plugin that replaces the Chugging barrel’s drink sound. RuneLite sound events enter the plugin; matching events are consumed and trigger playback of a randomly selected bundled WAV, adjusted by the configured volume. The plugin obtains its configuration through RuneLite’s ConfigManager and uses RuneLite’s AudioPlayer for playback. The README documents the settings slider and replacement behavior; the sampled source shows event handling and playback, but not RuneLite’s internal event dispatch or settings UI implementation.

Main entry points: [`src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`](https://github.com/astolfogamer-osrs/chugging-sound/blob/main/src/main/java/com/chuggingsound/ChuggingSoundPlugin.java) (Sound replacement), [`src/main/java/com/chuggingsound/ChuggingSoundConfig.java`](https://github.com/astolfogamer-osrs/chugging-sound/blob/main/src/main/java/com/chuggingsound/ChuggingSoundConfig.java) (Volume setting), [`src/main/resources/com/chuggingsound`](https://github.com/astolfogamer-osrs/chugging-sound/tree/main/src/main/resources/com/chuggingsound) (Custom WAV variants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Plugin runtime"]
  node_plugin["Sound replacement"]
  node_config["Volume setting"]
end

subgraph group_assets["Sound assets"]
  node_wav_files["Custom WAV variants"]
end

node_player(("RuneLite player"))
node_sound_events["RuneLite sound events"]
node_config_manager["RuneLite ConfigManager"]
node_audio_player["RuneLite AudioPlayer"]

node_player -.->|"triggers chug"| node_sound_events
node_sound_events -->|"dispatches events"| node_plugin
node_plugin -->|"requests config"| node_config_manager
node_plugin -->|"reads volume"| node_config
node_plugin -->|"selects variant"| node_wav_files
node_plugin -->|"plays sound"| node_audio_player

click node_plugin "https://github.com/astolfogamer-osrs/chugging-sound/blob/main/src/main/java/com/chuggingsound/ChuggingSoundPlugin.java"
click node_config "https://github.com/astolfogamer-osrs/chugging-sound/blob/main/src/main/java/com/chuggingsound/ChuggingSoundConfig.java"
click node_wav_files "https://github.com/astolfogamer-osrs/chugging-sound/tree/main/src/main/resources/com/chuggingsound"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_config toneBlue
class node_wav_files toneAmber
class node_player,node_sound_events,node_config_manager,node_audio_player toneIndigo
```

## Components

### Plugin runtime

- [Sound replacement](https://github.com/astolfogamer-osrs/chugging-sound/blob/main/src/main/java/com/chuggingsound/ChuggingSoundPlugin.java): `src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`
- [Volume setting](https://github.com/astolfogamer-osrs/chugging-sound/blob/main/src/main/java/com/chuggingsound/ChuggingSoundConfig.java): `src/main/java/com/chuggingsound/ChuggingSoundConfig.java`

### Sound assets

- [Custom WAV variants](https://github.com/astolfogamer-osrs/chugging-sound/tree/main/src/main/resources/com/chuggingsound): `src/main/resources/com/chuggingsound`

### Other components

- **RuneLite player**
- **RuneLite sound events**
- **RuneLite ConfigManager**
- **RuneLite AudioPlayer**

## Connections

- RuneLite player → RuneLite sound events: triggers chug (evidence: `README.md`)
- RuneLite sound events → Sound replacement: dispatches events (evidence: `src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`)
- Sound replacement → RuneLite ConfigManager: requests config (evidence: `src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`)
- Sound replacement → Volume setting: reads volume (evidence: `src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`)
- Sound replacement → Custom WAV variants: selects variant (evidence: `src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`)
- Sound replacement → RuneLite AudioPlayer: plays sound (evidence: `src/main/java/com/chuggingsound/ChuggingSoundPlugin.java`)
