Skip to content

These docs were made completely by AI, so they might be right, or wrong, you'll need to test them yourself. This was made for a easier understanding of everything. So use at your own risk. If anything is wrong, please don't hurt to make a PR on the page you have a problem with. ON GITHUB

Windows 64

The Windows 64-bit port is the main development target for LCE. It lives in Minecraft.Client/Windows64/ and provides a full PC implementation using Direct3D 11 for rendering and Winsock2 for networking.

FilePurpose
Windows64_App.h/.cppCConsoleMinecraftApp application class
Windows64_Minecraft.cppEntry point (WinMain), main game loop
Windows64_UIController.h/.cppConsoleUIController with Iggy-based UI
Windows64_PostProcess.h/.cppGamma correction post-process shader
Network/WinsockNetLayer.h/.cppTCP/UDP LAN networking layer
Leaderboards/WindowsLeaderboardManager.h/.cppLeaderboard stub
Minecraft_Macros.hSlot display and skin bitmask packing macros
4JLibs/inc/4J_Render.hC4JRender class, Direct3D 11 rendering abstraction
4JLibs/inc/4J_Input.hC_4JInput class, gamepad/keyboard input
4JLibs/inc/4J_Storage.hC4JStorage class, filesystem save/load
4JLibs/inc/4J_Profile.hProfile management
KeyboardMouseInput.h/.cppFull keyboard and mouse input class (MinecraftConsoles)
Windows64_Xuid.hPersistent player UID system with uid.dat (MinecraftConsoles)
PostProcesser.cppPost-process implementation (MinecraftConsoles)

CConsoleMinecraftApp inherits from CMinecraftApp and provides a minimal implementation for PC. It handles:

  • Thumbnail capture (m_ThumbnailBuffer of type ImageFileBuffer)
  • TMS file loading (local filesystem)
  • Stub implementations for console-specific features (banned list, string table returns NULL)

Windows64_Minecraft.cpp defines the Win32 entry point. The startup sequence:

  1. Parse command-line arguments for username, resolution, and multiplayer options
  2. Create the Win32 window with CreateWindowEx
  3. Initialize Direct3D 11 device and swap chain
  4. Initialize RenderManager, InputManager, ProfileManager, StorageManager
  5. Define gamepad action mappings (DefineActions), same Xbox 360 button layout
  6. Initialize thread-local storage for Tesselator, AABB, Vec3, IntCache, Compression
  7. Call Minecraft::main() to set up the game instance
  8. Run the intro sequence, then enter the main game loop

The main loop processes input, profiles, storage, rendering, sound, network ticks, and UI (Iggy) rendering each frame.

Global configuration:

  • Default resolution: 1920x1080 (g_iScreenWidth, g_iScreenHeight)
  • Username stored in g_Win64Username (max 16 characters)

Uses Direct3D 11 through the C4JRender abstraction in 4JLibs/inc/4J_Render.h. The render manager provides an OpenGL-style API with constants like GL_SRC_ALPHA, GL_DEPTH_BUFFER_BIT, etc., mapped to D3D11 equivalents.

Key rendering features:

  • Matrix stack (modelview, projection, texture)
  • Command buffer system for batched rendering (CBuffCreate, CBuffStart, CBuffCall)
  • Texture management with create/bind/data upload
  • Splitscreen viewport support (fullscreen, 2-way split, 4-way quadrants)
  • Conditional rendering with survey/query system

A dedicated post-process pass handles gamma correction via Windows64_PostProcess.h:

bool InitGammaPostProcess();
void ApplyGammaPostProcess();
void SetGammaValue(float gamma);

C_4JInput (the InputManager singleton) provides:

  • Gamepad support with Xbox 360-style button constants (_360_JOY_BUTTON_A, etc.)
  • Three control schemes (MAP_STYLE_0, MAP_STYLE_1, MAP_STYLE_2) for remappable layouts
  • Analog stick access with deadzone and sensitivity settings
  • Key repeat rate configuration
  • Keyboard input dialog (RequestKeyboard) with multiple modes (default, numeric, password, alphabet, IP address)
  • String verification against offensive word lists (TCR 092 compliance)
  • Southpaw and swap-triggers axis remapping

The Windows 64 port also includes KeyboardMouseInput for PC-native keyboard and mouse controls.

The WinsockNetLayer class provides a custom TCP-based networking layer with LAN discovery:

  • Host: Listens on a configurable port (default 25565) and accepts TCP connections via a dedicated accept thread
  • Client: Connects to a host via IP/port
  • Max clients: 7 (WIN64_NET_MAX_CLIENTS), max packet size 3 MB

Each connected player gets a smallId (single byte) for efficient addressing. The layer supports:

  • SendToSmallId for sending data to a specific player
  • PopPendingJoinSmallId / PopDisconnectedSmallId for tracking join/leave events
  • Thread-safe connection management with per-connection CRITICAL_SECTION locks

UDP broadcast on port 25566 (WIN64_LAN_DISCOVERY_PORT) with a Win64LANBroadcast packet containing:

  • Magic number 0x4D434C4E (“MCLN”)
  • Net version, game port, host name
  • Player count, max players, game settings
  • Texture pack IDs, joinability flag, dedicated server flag
  • Player names (up to 8 slots)

Discovery runs on a separate thread and returns Win64LANSession structs via GetDiscoveredSessions().

extern bool g_Win64MultiplayerHost;
extern bool g_Win64MultiplayerJoin;
extern int g_Win64MultiplayerPort;
extern char g_Win64MultiplayerIP[256];

ConsoleUIController inherits from UIController (Iggy-based) and provides Direct3D 11-specific rendering:

  • Initialized with ID3D11Device, ID3D11DeviceContext, render target view, and depth stencil view
  • Custom draw callbacks for Iggy regions (beginIggyCustomDraw4J, setupCustomDraw, endCustomDraw)
  • Texture substitution support (getSubstitutionTexture, destroySubstitutionTexture)

Uses filesystem-based storage through C4JStorage. Save data is stored as local files. The SAVE_INFO struct contains UTF-8 filenames, titles, metadata (modification time, data size, thumbnail size), and thumbnail data.

  • Keyboard and mouse input: Full KeyboardMouseInput class for PC controls alongside gamepad
  • Windowed mode: Win32 window creation with configurable resolution
  • Post-process gamma: Shader-based gamma correction since Windows doesn’t provide system-level gamma like consoles do
  • No DRM/commerce: Simplified app class without storefront integration
  • Command-line multiplayer: Can specify host/join via command-line globals

The MinecraftConsoles codebase adds several files to the Windows 64 platform that were not in LCEMP.

KeyboardMouseInput.h/.cpp provides a full keyboard and mouse input system for PC-native controls. This runs alongside the gamepad input and supports:

  • 256 virtual key tracking with per-frame press/release detection
  • 3 mouse buttons (left, right, middle) with press/release detection
  • Raw mouse delta for low-latency mouse look via ConsumeMouseDelta()
  • Mouse grab mode for locking the cursor to the game window
  • Text input buffering with OnChar() / ConsumeChar() for keyboard scenes
  • Mouse wheel accumulator with consumption tracking
  • KBM active flag to switch between gamepad and keyboard/mouse mode
  • WASD movement with dedicated key constants (KEY_FORWARD = 'W', KEY_BACKWARD = 'S', KEY_LEFT = 'A', KEY_RIGHT = 'D')
  • Standard PC bindings: Space = jump, LShift = sneak, Ctrl = sprint, E = inventory, Q = drop, C/R = crafting, F5 = third person, F3 = debug info, F4 = debug menu

MinecraftConsoles adds a persistent player identity system for Windows 64 via Windows64_Xuid.h. In LCEMP, player UIDs were ephemeral (based on a hardcoded base value plus the small ID). MinecraftConsoles generates a random UID and stores it in a uid.dat file next to the executable.

Key functions:

  • GetLegacyEmbeddedBaseXuid() returns the old LCEMP base value (0xe000d45248242f2e)
  • IsLegacyEmbeddedRange(xuid) detects old-style non-persistent UIDs
  • IsPersistedUidValid(xuid) validates that a UID is not legacy and not invalid
  • BuildUidFilePath() constructs the path to uid.dat relative to the executable
  • ReadUid() / WriteUid() handle loading and saving the persistent UID
  • GenerateRandomXuid() creates a new random UID if none exists

This means worlds saved on MinecraftConsoles can track player ownership across sessions, while LCEMP worlds could not.

MinecraftConsoles bundles the Iggy UI library source directly under Windows64/Iggy/:

  • gdraw/gdraw_d3d.cpp/.h (Direct3D 9 backend)
  • gdraw/gdraw_d3d10.cpp/.h (Direct3D 10 backend)
  • gdraw/gdraw_d3d11.cpp/.h (Direct3D 11 backend)
  • gdraw/gdraw_wgl.h (OpenGL WGL backend)
  • include/iggy.h, include/gdraw.h, include/iggyexpruntime.h, include/iggyperfmon.h, include/rrCore.h

The Sentient telemetry SDK is also bundled under Windows64/Sentient/ with configuration headers for analytics tracking.