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.

What this means for players: The user interface is written in native Rust with Slint UI, completely isolated from downloads, modpacks, and Java game execution. Even when extracting a 5 GB modpack or loading heavy shaderpacks, the launcher window never stutters, freezes, or spikes your CPU. There is zero Electron or Chromium overhead.

Player Quick Start: Zero to In-Game

  1. Launch Ny-Luna: Open the AppImage on Linux or the executable on Windows.
  2. 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.
  3. 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).
  4. 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_gameBoots Minecraft with selected modloader and JVM flagsinstance_id, account, offline_name
accounts_listLists all stored Microsoft, Ely.by, and offline accounts{}
accounts_selectSets active profile index or UUIDid, index, username
accounts_auth_offlineCreates or updates an offline profileusername, skin_model
accounts_removeDeletes a stored account and purges tokensuuid, username, index
accounts_ms_startRequests Microsoft OAuth2 Device Code grant{}
accounts_ms_pollPolls Microsoft Identity token endpoint for completiondevice_code
config_getFetches active launcher settings{}
config_setUpdates launcher configuration attributes{ key: value, ... }
mods_list_installedEnumerates mods in an instance directoryinstance_id
mods_toggle_enabledToggles mod .jar vs .jar.disabled stateinstance_id, filename, enabled
modrinth_searchQueries Modrinth API for mods, packs, and shadersquery, project_type, loader, version
skin_get_currentReads active player skin and cape file paths{}
skin_set_customAssigns custom skin PNG file to profilepath, skin_model
capes_listFetches owned official and third-party capes{}
capes_selectEquips or unequips a capecape_id, active
get_discord_statusReturns Discord Rich Presence connection state{}
pingHeartbeat check returning pong{}
agent_shutdownGracefully closes connections and shuts down workers{}

Process Supervision & Watchdog

Crash Safety Guarantee: If the launcher window ever closes unexpectedly, background tasks and helper workers terminate automatically without leaving zombie processes draining your CPU or RAM.
  • 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() == 1 and 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

Player Security Guarantee: Ny-Luna Core never asks for or stores your Microsoft password. Logins happen entirely inside your official web browser via Microsoft OAuth 2.0 Device Flow. All tokens are encrypted on disk using system-level hardware encryption.

Microsoft / Mojang (Official OAuth 2.0)

  1. 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.
  2. Xbox Live Token: The Microsoft authorization token is exchanged with user.auth.xboxlive.com to obtain an Xbox Live authentication token.
  3. XSTS Security Hash: The Xbox Live token is exchanged with xsts.auth.xboxlive.com (RelyingParty rp://api.minecraftservices.com/) to generate an XSTS token and user hash.
  4. Minecraft Access Token: The launcher contacts api.minecraftservices.com/authentication/login_with_xbox to 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).
UUID Notice for Singleplayer Saves: In Minecraft, single-player inventories, advancements, and tamed pets are saved under your player UUID. If you create a single-player world in Offline mode and later switch to a Microsoft account, your inventory will not transfer automatically because the Microsoft UUID is different.

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-id or /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
VanillaMojang Official ManifestAutomated asset, library, and client jar download from launchermeta.mojang.com.
FabricFabric Meta APIDirect Maven library resolution via meta.fabricmc.net.
ForgeForge Installer PipelineFull support for legacy (1.7.10/1.12.2) and modern (1.20+) Forge processor pipelines.
NeoForgeNeoForged Maven APIModern NeoForged installer and bootstrap runtime.
QuiltQuilt Meta APIFabric-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

Zero Manual Flag Setup: Ny-Luna automatically detects your installed Java runtime and injects optimized Aiken G1GC arguments to eliminate Java stutter and garbage collection spikes. You do not need to configure command-line flags manually.
Minecraft Version Required Java Runtime Recommended RAM Allocation
1.7.10 — 1.16.5Java 8 (OpenJDK / Temurin)3 GB – 4 GB
1.17 — 1.20.4Java 174 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

  1. Navigate to the Locker / Wardrobe tab on the left sidebar.
  2. Select your model: Classic (Steve - 4px arm) or Slim (Alex - 3px arm).
  3. Click Upload Custom Skin and choose any standard 64x64 or legacy 64x32 PNG skin file.
  4. 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:

  1. LocalSkinServer binds to 127.0.0.1 on an ephemeral random port (port 0).
  2. GET / returns HTTP 200 with header X-Authlib-Injector-API-Location: /.
  3. 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

Lightning-Fast Delta Updates: When an update drops, FastCDC downloads only the changed chunks (typically 2–5 MB) instead of re-downloading the entire 100 MB launcher. All updates are cryptographically signed with Ed25519 to prevent tampering.

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 SymlinksNone/usr/local/bin/nlc, /usr/local/bin/newlauncher
Desktop EntriesDesktop 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-hPlayerPrints complete syntax guide and exits immediately.
--version-vPlayerDisplays current launcher release version and exits.
--uninstallNoneAdminLaunches interactive Linux uninstaller with confirmation prompt.
--instanceNonePlayerBoots directly into the specified Minecraft instance.
--accountNonePlayerSpecifies account to use for game launch.
--offline-userNonePlayerLaunches an offline game session directly.
--dirNonePlayerOverrides the root .minecraft storage directory.
--debugNonePlayerEnables verbose debug logging in console and logs directory.
--snapshot-tabNoneDev / CIRenders a headless visual snapshot of a specific tab without opening a window (automated test suite).
--agent, --backendNoneDevBoots 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 0Clean shutdown or manual quit.Normal behavior.
Exit 1Mod 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 137Linux 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 pip and virtualenv
  • Rust & Cargo: Stable toolchain 1.80+
  • Linux Packages: libfuse2 (or libfuse2t64), 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.