# furqit/resourcepackcached architecture

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

- Interactive diagram: https://gitdiagram.com/furqit/resourcepackcached
- Repository: https://github.com/furqit/resourcepackcached

## Overview

ResourcePackCached is a client-side Minecraft mod that preserves downloaded server resource packs across disconnects and reapplies cached packs at game startup. Loader entrypoints initialize shared cache state; startup verification feeds the downloaded-pack manager, while mixins intercept server-pack events to reuse cached files, track incoming packs, and persist live-pack snapshots. The README also documents faster rejoins and reduced repeated loading. Source excerpts show the cache and lifecycle hooks; some verification and pack-sweep details are only partially sampled.

Main entry points: [`src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java`](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java) (Cache Coordination), [`src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java`](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java) (Startup Bootstrap), [`src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java`](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java) (Server Pack Manager Hooks), [`src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java`](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java) (Downloaded Pack Hooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Loader and Startup"]
  node_fabric["Fabric Entrypoint<br/>[FabricInit.java]"]
  node_neoforge["NeoForge Entrypoint<br/>[NeoInit.java]"]
  node_boot["Startup Bootstrap"]
end

subgraph group_lifecycle["Pack Lifecycle"]
  node_manager["Server Pack Manager Hooks"]
  node_configuration["Join Configuration Hook"]
  node_downloaded["Downloaded Pack Hooks"]
  node_world["World Load Hook"]
end

subgraph group_cache["Cache and Persistence"]
  node_cachelogic["Cache Coordination<br/>[CachingUtils.java]"]
  node_downloadfiles[("Downloaded Pack Files")]
  node_snapshot[("Cache Snapshot JSON")]
end

node_player(("Minecraft Player"))
node_game["Minecraft Pack Runtime"]

node_player -->|"starts client"| node_fabric
node_player -.->|"starts client"| node_neoforge
node_fabric -->|"invokes boot"| node_boot
node_neoforge -.->|"invokes boot"| node_boot
node_boot -->|"initializes and verifies"| node_cachelogic
node_boot -->|"reapplies cached packs"| node_game
node_boot -->|"loads verified files"| node_downloadfiles
node_manager -->|"tracks pack events"| node_cachelogic
node_manager -->|"reuses cached file"| node_downloadfiles
node_manager -->|"pushes local pack"| node_game
node_configuration -->|"records connection"| node_cachelogic
node_downloaded -->|"snapshots and resets"| node_cachelogic
node_downloaded -->|"triggers pack reload"| node_game
node_world -->|"clears live packs"| node_cachelogic
node_cachelogic -->|"checks pack files"| node_downloadfiles
node_cachelogic -->|"reads and writes metadata"| node_snapshot

click node_fabric "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/FabricInit.java"
click node_neoforge "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/NeoInit.java"
click node_boot "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java"
click node_manager "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java"
click node_configuration "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/ClientConfigurationListenerMixin.java"
click node_downloaded "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java"
click node_world "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/MinecraftMixin.java"
click node_cachelogic "https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java"

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_fabric,node_neoforge,node_boot toneBlue
class node_manager,node_configuration,node_downloaded,node_world toneAmber
class node_cachelogic,node_downloadfiles,node_snapshot toneMint
class node_player,node_game toneIndigo
```

## Components

### Loader and Startup

- [Fabric Entrypoint](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/FabricInit.java): `src/main/java/dev/furq/resourcepackcached/FabricInit.java`
- [NeoForge Entrypoint](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/NeoInit.java): `src/main/java/dev/furq/resourcepackcached/NeoInit.java`
- [Startup Bootstrap](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java): `src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java`

### Pack Lifecycle

- [Server Pack Manager Hooks](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java): `src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java`
- [Join Configuration Hook](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/ClientConfigurationListenerMixin.java): `src/main/java/dev/furq/resourcepackcached/mixin/ClientConfigurationListenerMixin.java`
- [Downloaded Pack Hooks](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java): `src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java`
- [World Load Hook](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/mixin/MinecraftMixin.java): `src/main/java/dev/furq/resourcepackcached/mixin/MinecraftMixin.java`

### Cache and Persistence

- [Cache Coordination](https://github.com/furqit/resourcepackcached/blob/main/src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java): `src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java`
- **Downloaded Pack Files**
- **Cache Snapshot JSON**

### Other components

- **Minecraft Player**
- **Minecraft Pack Runtime**

## Connections

- Minecraft Player → Fabric Entrypoint: starts client (evidence: `src/main/java/dev/furq/resourcepackcached/FabricInit.java`)
- Minecraft Player → NeoForge Entrypoint: starts client (evidence: `src/main/java/dev/furq/resourcepackcached/NeoInit.java`)
- Fabric Entrypoint → Startup Bootstrap: invokes boot (evidence: `src/main/java/dev/furq/resourcepackcached/FabricInit.java`)
- NeoForge Entrypoint → Startup Bootstrap: invokes boot (evidence: `src/main/java/dev/furq/resourcepackcached/NeoInit.java`)
- Startup Bootstrap → Cache Coordination: initializes and verifies (evidence: `src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java`)
- Startup Bootstrap → Minecraft Pack Runtime: reapplies cached packs (evidence: `src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java`)
- Startup Bootstrap → Downloaded Pack Files: loads verified files (evidence: `src/main/java/dev/furq/resourcepackcached/ResourcePackCached.java`)
- Server Pack Manager Hooks → Cache Coordination: tracks pack events (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java`)
- Server Pack Manager Hooks → Downloaded Pack Files: reuses cached file (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java`)
- Server Pack Manager Hooks → Minecraft Pack Runtime: pushes local pack (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/ServerPackManagerMixin.java`)
- Join Configuration Hook → Cache Coordination: records connection (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/ClientConfigurationListenerMixin.java`)
- Downloaded Pack Hooks → Cache Coordination: snapshots and resets (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java`)
- Downloaded Pack Hooks → Minecraft Pack Runtime: triggers pack reload (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/DownloadedPackSourceMixin.java`)
- World Load Hook → Cache Coordination: clears live packs (evidence: `src/main/java/dev/furq/resourcepackcached/mixin/MinecraftMixin.java`)
- Cache Coordination → Downloaded Pack Files: checks pack files (evidence: `src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java`)
- Cache Coordination → Cache Snapshot JSON: reads and writes metadata (evidence: `src/main/java/dev/furq/resourcepackcached/utils/CachingUtils.java`)
