Ny-Luna Core — Architecture & Technical Wiki
Last Updated: 2026-10-31 | Launcher Version: v4.1.0 | License: BSD-3-Clause
1. Overview & System Architecture
Ny-Luna Core (NLC) is a high-performance, open-source Minecraft Java Edition launcher designed for Windows and Linux. Built with a modern decoupled topology, Ny-Luna separates presentation from heavy computing to deliver native GPU-accelerated rendering and robust process isolation.
Player Quick Start: Zero to In-Game
- Launch Ny-Luna: Open the AppImage on Linux or the executable on Windows.
- Set Up an Account: Click your avatar in the upper right or go to Accounts:
- Microsoft Account: Complete the one-click official browser device code flow.
- Offline Account: Type any username (e.g.
Alex) and hit enter.
- Select an Installation: On the Play screen, pick an existing version or click Installations → New Installation to choose any release, snapshot, or modloader (Fabric, Forge, NeoForge, Quilt).
- Hit Play: Ny-Luna automatically retrieves libraries, applies tuned Java arguments, and boots your game!
Process Topology
The launcher coordinates across three isolated operating system processes:
| Process Domain | Binary / Entry | Language / Framework | Core Responsibilities |
|---|---|---|---|
| Frontend GUI | nlc-ui / NyLuna.exe |
Rust & Slint UI | Hardware-accelerated window chrome, interactive tabs, real-time UI state, zero-overhead input handling. |
| Daemon Agent | agent.py / agent / agent.exe |
Python 3.12+ (Daemon) | Game launches, OAuth2 & Ely.by authentication, local skin proxy, Modrinth/CurseForge APIs, Discord RPC. |
| Patch Supervisor | NLCUpdater.exe / patch_runner.py |
Elevated C/Python Runner | Detached supervisor launched with UAC elevation to terminate locked processes and perform atomic binary updates. |
2. Process Model, IPC Protocol & Lifecycle
The GUI and the background agent communicate over standard input and standard output (stdin / stdout) using line-buffered UTF-8 JSON. Every request carries a client-generated UUID for correlation:
// Client Request (GUI -> Agent)
{"id": "7c8d9e2a-1b4f-4a88-8cf9-123456789abc", "action": "search_mods", "payload": {"query": "sodium", "loader": "fabric", "version": "1.21.1"}}
// Agent Response (Agent -> GUI)
{"id": "7c8d9e2a-1b4f-4a88-8cf9-123456789abc", "result": {"status": "success", "data": [{"id": "AANobbMI", "title": "Sodium"}]}, "error": null}
Unsolicited push events stream asynchronously using the event envelope:
{"event": "download_progress", "payload": {"file": "minecraft.jar", "current": 14200000, "total": 28400000, "percent": 50.0}}
IPC Action Catalog
| Action | Description | Key Parameters |
|---|---|---|
launch_game | Boots Minecraft with selected modloader and JVM flags | instance_id, account, offline_name |
accounts_list | Lists all stored Microsoft, Ely.by, and offline accounts | {} |
accounts_select | Sets active profile index or UUID | id, index, username |
accounts_auth_offline | Creates or updates an offline profile | username, skin_model |
accounts_remove | Deletes a stored account and purges tokens | uuid, username, index |
accounts_ms_start | Requests Microsoft OAuth2 Device Code grant | {} |
accounts_ms_poll | Polls Microsoft Identity token endpoint for completion | device_code |
config_get | Fetches active launcher settings | {} |
config_set | Updates launcher configuration attributes | { key: value, ... } |
mods_list_installed | Enumerates mods in an instance directory | instance_id |
mods_toggle_enabled | Toggles mod .jar vs .jar.disabled state | instance_id, filename, enabled |
modrinth_search | Queries Modrinth API for mods, packs, and shaders | query, project_type, loader, version |
skin_get_current | Reads active player skin and cape file paths | {} |
skin_set_custom | Assigns custom skin PNG file to profile | path, skin_model |
capes_list | Fetches owned official and third-party capes | {} |
capes_select | Equips or unequips a cape | cape_id, active |
get_discord_status | Returns Discord Rich Presence connection state | {} |
ping | Heartbeat check returning pong | {} |
agent_shutdown | Gracefully closes connections and shuts down workers | {} |
Process Supervision & Watchdog
- Stdin EOF Monitoring: The main dispatch loop blocks on
sys.stdin.readline(). When the parent GUI exits, the pipe closes, yielding an empty string and triggering immediate graceful worker pool shutdown. - Orphan PID Watchdog (Linux): If the parent process crashes abruptly without closing pipes, a background thread checks if
os.getppid() == 1and terminates the agent. - Windows Job Objects: On Windows, child processes are attached to a Job Object configured with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.
3. Authentication Engines & Credential Vault
Microsoft / Mojang (Official OAuth 2.0)
- Device Code Flow: The launcher requests an authorization code from Microsoft Identity (
https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode). The user enters the code in their browser. - Xbox Live Token: The Microsoft authorization token is exchanged with
user.auth.xboxlive.comto obtain an Xbox Live authentication token. - XSTS Security Hash: The Xbox Live token is exchanged with
xsts.auth.xboxlive.com(RelyingPartyrp://api.minecraftservices.com/) to generate an XSTS token and user hash. - Minecraft Access Token: The launcher contacts
api.minecraftservices.com/authentication/login_with_xboxto acquire the final Bearer token, fetches game ownership entitlements, and retrieves UUID and skins.
Ely.by Account Integration
Integrates directly with Ely.by's open skin and auth architecture. The launcher authenticates against https://authserver.ely.by/auth/authenticate, retrieves an access token and profile ID, and launches Minecraft using authlib-injector directed to Ely.by servers.
Offline (Local) Profiles & Multiplayer Realities
Offline profiles allow instant gameplay without logging into Microsoft:
- Single-Player: 100% functional with local saves and custom offline skins.
- LAN Multiplayer: You can play with friends on your local home Wi-Fi network without requiring internet access.
- Online Community Servers: You can join dedicated community servers configured with
online-mode=false(cracked/offline servers). You cannot join official Mojang servers like Hypixel. - Deterministic UUID: Generated via standard Minecraft algorithm
uuid.uuid3(uuid.NAMESPACE_DNS, "OfflinePlayer:" + player_name).
Credential Vault
All sensitive tokens are stored inside encrypted blocks in launcher_config.json:
- Windows: Protected with Windows Data Protection API (DPAPI via
CryptProtectData), tying decryption strictly to the logged-in Windows user account. - Linux: Protected with AES-256-GCM. The key is derived via PBKDF2 from the machine's hardware ID (
/etc/machine-idor/var/lib/dbus/machine-id) combined with the POSIX user ID and a cryptographic salt.
4. Installations, Modloaders & JVM Architecture
Ny-Luna enables complete management of game installations with automated modloader bootstrap:
Supported Modloaders
| Modloader | Resolution Method | Notes |
|---|---|---|
| Vanilla | Mojang Official Manifest | Automated asset, library, and client jar download from launchermeta.mojang.com. |
| Fabric | Fabric Meta API | Direct Maven library resolution via meta.fabricmc.net. |
| Forge | Forge Installer Pipeline | Full support for legacy (1.7.10/1.12.2) and modern (1.20+) Forge processor pipelines. |
| NeoForge | NeoForged Maven API | Modern NeoForged installer and bootstrap runtime. |
| Quilt | Quilt Meta API | Fabric-compatible loader with native Quilt standard libraries. |
Instance Isolation & Junctions
Each profile can be isolated into its own directory (instances/<id>/). To avoid duplicating shared game assets across multiple installations, Ny-Luna creates filesystem reparse points:
- Windows: NTFS Directory Junctions via
_winapi.CreateJunction(operates without Administrator privileges or Developer Mode). - Linux: POSIX symbolic links (
os.symlink).
Java Version Matrix & Pre-Tuned GC
| Minecraft Version | Required Java Runtime | Recommended RAM Allocation |
|---|---|---|
| 1.7.10 — 1.16.5 | Java 8 (OpenJDK / Temurin) | 3 GB – 4 GB |
| 1.17 — 1.20.4 | Java 17 | 4 GB – 6 GB |
| 1.20.5 — 1.21.x+ | Java 21+ | 4 GB – 8 GB (Heavy Modpacks) |
5. Skin System, Wardrobe & 3D Engine
How to Set Your Skin in the Launcher
- Navigate to the Locker / Wardrobe tab on the left sidebar.
- Select your model: Classic (Steve - 4px arm) or Slim (Alex - 3px arm).
- Click Upload Custom Skin and choose any standard
64x64or legacy64x32PNG skin file. - Click and drag the 3D viewport to inspect your character in real-time with walk and cape flutter animations!
JVM Injection Model
During launch, the launcher injects authlib-injector via standard Java agent flags without modifying the game JAR:
-javaagent:{minecraft_dir}/authlib-injector.jar=http://127.0.0.1:{port}
Ephemeral Local Yggdrasil Proxy
When an offline account has a custom skin configured:
LocalSkinServerbinds to127.0.0.1on an ephemeral random port (port 0).GET /returns HTTP 200 with headerX-Authlib-Injector-API-Location: /.- Intercepts session requests at
/sessionserver/session/minecraft/profile/{uuid}and streams the local PNG texture directly from disk.
Software 3D Skin Preview Engine (Engine Details)
The Wardrobe Locker renders interactive 3D skin models via a software rasterizer built in Pillow and NumPy, featuring legacy 64x32 to 64x64 normalization, Euler camera rotation matrices, backface polygon culling, directional sun lighting, and real-time walk/flutter animations.
6. Modpacks, Mods & Content Delivery
Modrinth API Integration
Directly search, filter, and install mods, resource packs, modpacks, and shaderpacks from the Modrinth tab. Downloads .mrpack archives, extracts index files, and validates SHA-1/SHA-512 hashes across concurrent network streams.
CurseForge Importer
Extracts CurseForge ZIP packages, resolves projectID and fileID manifests, and pulls dependencies. Includes Zip Slip directory traversal defenses.
Non-Destructive Mod Toggling
Disabling a mod in the UI renames the file to *.jar.disabled, preventing loaders from mounting the JAR while preserving configs, version info, and download cache.
7. Addons Framework & Ecosystem
Addon Structure
Addons are modular Python packages residing in ~/.nlc/addons/<addon_id>/ containing an addon.json manifest and a main.py entrypoint.
{
"id": "server_backup",
"name": "World Backup Helper",
"version": "1.0.0",
"author": "Community",
"entrypoint": "main.py",
"actions": [
{
"id": "backup_active_world",
"name": "Backup Active World",
"inputs": [{"name": "world_name", "type": "string"}]
}
]
}
Built-in Features
- Streamer Mode: Masks sensitive tokens, player IDs, and filesystem paths in the UI.
- Server Monitor: Live TCP pings against server IPs displaying ping latency, MOTD, and player counts.
- Playtime Tracker: Persists and calculates total playtime per game installation.
8. FastCDC Differential Binary Updater
FastCDC Gear Rolling Hash
Dynamic chunk boundaries are calculated using a 256-entry 32-bit Gear lookup table:
- Min Chunk Size: 16 KB (prevents fragment explosion).
- Average Chunk Size: 64 KB (optimal bandwidth efficiency).
- Max Chunk Size: 256 KB (upper bound).
- Boundary Condition:
(fp & 0x0000FFFF) == 0.
Patch Verification & Atomic Assembly
The update manifest (newlauncher.exe.cdc.json) is signed with an Ed25519 key. Chunks already present locally are reused with zero network transfer. Missing contiguous chunks under 32 KB are coalesced into single HTTP range requests. After SHA-256 verification, the new binary is promoted atomically via os.replace (Linux) or elevated NLCUpdater.exe (Windows).
9. Storage Layout, File Locations & Atomic I/O
Filesystem Locations
| Content | Windows Path | Linux Path |
|---|---|---|
| Launcher Data Root | %APPDATA%\.nlc | ~/.nlc |
| Configuration File | %APPDATA%\.nlc\launcher_config.json | ~/.nlc/launcher_config.json |
| Single-Instance Lock | %APPDATA%\.nlc\launcher.lock | @nlc-single-instance-lock (Abstract Socket) |
| Logs & Crashes | %APPDATA%\.nlc\logs\ | ~/.nlc/logs/ |
| Default Game Dir | %APPDATA%\.minecraft | ~/.minecraft |
| System Installation | %LOCALAPPDATA%\Programs\Ny-Luna | /opt/new-launcher |
| System Symlinks | None | /usr/local/bin/nlc, /usr/local/bin/newlauncher |
| Desktop Entries | Desktop Shortcut, Start Menu | /usr/share/applications/nlc.desktop |
Atomic Persistence Protocol
To prevent configuration loss during system crashes, writes follow an atomic four-step protocol: create temporary file nlc_cfg_*.tmp, flush with os.fsync, create backup copy launcher_config.json.bak, and atomically rename over destination with os.replace.
10. Command-Line Interface (CLI Reference)
Player & Automation Shortcuts
# Launch standard GUI
nlc
# Print version information
nlc --version
# Print command-line help
nlc --help
# Launch directly into an instance (bypasses main menu)
nlc --instance "Fabric 1.21" --account "MyUsername"
# Launch in offline mode immediately
nlc --offline-user "Alex"
# Store/load game data from a secondary drive or custom directory
nlc --dir "/mnt/games/minecraft"
# Launch with verbose debug logging in terminal
nlc --debug
# Interactive uninstaller on Linux (asks confirmation)
nlc --uninstall
CLI Argument Matrix
| Flag | Short | Scope | Description |
|---|---|---|---|
--help | -h | Player | Prints complete syntax guide and exits immediately. |
--version | -v | Player | Displays current launcher release version and exits. |
--uninstall | None | Admin | Launches interactive Linux uninstaller with confirmation prompt. |
--instance | None | Player | Boots directly into the specified Minecraft instance. |
--account | None | Player | Specifies account to use for game launch. |
--offline-user | None | Player | Launches an offline game session directly. |
--dir | None | Player | Overrides the root .minecraft storage directory. |
--debug | None | Player | Enables verbose debug logging in console and logs directory. |
--snapshot-tab | None | Dev / CI | Renders a headless visual snapshot of a specific tab without opening a window (automated test suite). |
--agent, --backend | None | Dev | Boots headless Python daemon agent on stdio without starting the GUI. |
11. Diagnostics, Exit Codes & Troubleshooting
Linux FUSE Requirements (AppImage)
If the AppImage outputs dlopen(): error loading libfuse.so.2, install FUSE 2:
- Ubuntu 22.04 LTS & Debian 12:
sudo apt install -y libfuse2 - Ubuntu 24.04 LTS & Newer:
sudo apt install -y libfuse2t64 - Arch Linux / Manjaro:
sudo pacman -S fuse2 - Fedora:
sudo dnf install fuse
Minecraft Crash Exit Codes
| Exit Code | Common Cause | Resolution Steps |
|---|---|---|
Exit 0 | Clean shutdown or manual quit. | Normal behavior. |
Exit 1 | Mod conflict, missing dependency, or invalid Java argument. | Check latest.log. Check that mod versions match your loader. Remove recently added mods one by one. |
Exit -1073740791(0xC0000409) | GPU driver crash or incompatible overlay (RivaTuner, GeForce Experience, Discord overlay). | Update graphics drivers (NVIDIA / AMD / Intel) and disable third-party in-game overlays. |
Exit 137 | Linux Out-of-Memory (OOM) killer terminated the JVM. | Increase RAM allocation in Settings → Java & Memory. |
Wayland & KDE Plasma Diagnostics
Slint automatically uses Wayland when available. If your compositor has window title or scaling glitches, force XWayland via:
WINIT_UNIX_BACKEND=x11 nlc
Linux Uninstallation
To completely uninstall Ny-Luna Core and clean up desktop entries:
nlc --uninstall
# Or run standalone uninstaller:
./packaging/linux/uninstall.sh
12. Development, Build & Licensing
Local Build Requirements
- Python 3.12+: with
pipandvirtualenv - Rust & Cargo: Stable toolchain 1.80+
- Linux Packages:
libfuse2(orlibfuse2t64),gcc,make,pkg-config,libfontconfig-dev
Building from Source
# 1. Clone repository
git clone https://github.com/Amne-Dev/NLC.git
cd NLC
# 2. Set up Python virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
# 3. Build & Run native Slint UI
cargo run --manifest-path src/frontend/Cargo.toml
Packaging Releases
- Linux AppImage:
./packaging/linux/build_appimage.sh - Arch Linux PKGBUILD:
cd packaging/linux && makepkg -si - Windows Installer: PyInstaller & InnoSetup scripts in
packaging/windows/
License Notice
Ny-Luna Core is released under the BSD-3-Clause License.