Mana StatsFeatured

Mana Stats

2022OngoingApplications

Overview

Mana Stats is a full-featured statistics and item-exploration platform for the ManaCube Minecraft server. Alongside player profiles, SVA collection tools, parkour data, guild insights, trading, and advanced search, it contains a custom rendering pipeline for ManaCube's resource packs. The system automatically downloads and indexes ManaPack assets, connects item materials and custom-model-data values to Minecraft and ModelEngine model definitions, stores model and texture metadata in PostgreSQL, and reconstructs the models as interactive React Three Fiber scenes. It resolves texture references and namespaces, translates Minecraft face UV coordinates and display transforms into Three.js materials, preserves pixel-art filtering, and supports vertically stacked animated textures described by .png.mcmeta files. A separate headless-browser worker renders those scenes into cached PNG thumbnails or frame-stepped GIF previews and selectively regenerates them when source textures change. The same platform data is also available through a companion Discord bot for profiles, parkour, guilds, economy, and other server information.

ReactTanStack StartTypeScriptThree.jsRustDiscordPostgreSQL

My Role

Full Stack Developer

Key Features

Player Search with username/UUID search and typo tolerance
Comprehensive Profiles with stats, friends, guilds, and parkour info
Player SVA Info with collection viewing, missing/duplicate detection, and CSV export
SVA Browser to discover SVAs by player or server ownership
Interactive 3D viewer for Minecraft and multipart ModelEngine models
Automatic ManaPack download, namespace discovery, model indexing, and incremental synchronization
Animated Minecraft texture support using .png.mcmeta frame definitions
Queued PNG and GIF thumbnail generation through headless WebGL rendering
Smart Embeds for sharing SVA previews, gifs, and player info in Discord
Parkour Hub for browsing maps by difficulty, builder, and leaderboard stats
Guild Insights for comparing guilds and exploring member lists
Staff & Patrons showcase highlighting contributors and ManaCube team
Advanced Search for filtering players, SVAs, maps, and more
Companion Rust Discord bot exposing profiles, parkour, guilds, economy, and earth map as slash commands

Challenges Solved

Reconstructing Minecraft and multipart ModelEngine models from resource-pack JSON rather than relying on export-ready 3D files
Translating Minecraft's per-face UV coordinates, rotations, inverted geometry, display transforms, and texture references into correct Three.js geometry and materials
Rendering .png.mcmeta animated textures consistently in both the interactive viewer and generated GIF previews
Keeping thousands of cached previews current by hashing texture assets and re-queuing only models affected by a pack update

Technical Details

Resource-pack ingestion

A background updater downloads the latest ManaPack archive, discovers every assets namespace, parses item overrides and custom-model-data mappings, follows Minecraft and ModelEngine model definitions, and synchronizes model elements, groups, materials, display transforms, texture references, and file hashes into PostgreSQL.

Texture reconstruction

PNG assets and their .png.mcmeta animation metadata are indexed by namespace and served to the viewer as encoded texture data. The client resolves indirect #texture references, applies nearest-neighbour filtering and sRGB colour space, then clones textures per face so each material can have independent UV offsets, repeats, rotations, and animation state.

Minecraft-to-Three.js rendering

Resource-pack cuboids are converted into Three.js geometry while preserving Minecraft coordinates, rotation origins, inverted dimensions, per-face UV rectangles, transparent pixels, GUI/display transforms, flat PNG item layers, and multipart ModelEngine assemblies. Animated sprite sheets advance by Minecraft tick timing or deterministic manual frame stepping.

Automated image generation

A pooled Puppeteer worker opens a dedicated WebGL model-viewer route, waits for explicit scene-ready and error signals, and captures static models as PNGs. Animated models are stepped frame by frame, captured as PNG buffers, decoded with pngjs, and assembled into looping GIFs. Texture hashes invalidate and regenerate only affected previews.

Tech Stack

Frontend

React 19TanStack RouterReact Three FiberThree.jsTailwind CSS

Backend

TanStack StartBunBetter AuthPuppeteer workersRust (Discord bot)

Database

PostgreSQLRedisDrizzle ORM

Tools & Services

DockerPuppeteerpngjsGIFEncoderPlaywrightPM2twilight / discord-bot-core

Screenshots

Mana Stats screenshot 1
Mana Stats screenshot 2
Mana Stats screenshot 3
Mana Stats screenshot 4
Mana Stats screenshot 5
Mana Stats screenshot 6
Mana Stats screenshot 7
Mana Stats screenshot 8
Mana Stats screenshot 9
Mana Stats screenshot 10
Mana Stats screenshot 11