Links
Tags
Creators
Details
Licensed GPL-3.0-only
Published 2 months ago
Updated last month
All versions
r1.0b5
Beta
r1.0b5last month 42
Compatibility
Minecraft: Java Edition
1.12.2
Platform
Forge
Supported environments
Client-side
Client and server
Changes
[EN]
Graphics Abstraction (IGraphics)
- Immediate Graphics Layer: Introduced
IGraphicsandGLGraphics, decoupling component rendering from direct OpenGL and LWJGL calls. - State Stack: Hierarchical management for matrix transformations, global alpha (
pushAlpha/popAlpha), color tint (pushColorTint/popColorTint), active font, and scissor clipping (pushClip/popClip) viasave()andrestore(). - Drawing Primitives: Built-in methods for flat and rounded rectangles, borders, lines, circles, and gradients.
Typography System (IFont, FontRegistry)
IFontAbstraction: Unified text rendering and metrics interface decoupled from vanillaFontRenderer.TrueTypeFontEngine: Hardware-accelerated rasterization for vector fonts (.ttf/.otf) and system fonts with anti-aliasing and full vanilla format code support (§0-§f).FontRegistry: Centralized registry for loading, resolving, and hot-reloading fonts on resource reload events (F3 + T).- Integration: Custom font support propagated through
IGraphics.setFont()andGuiComponent.withFont().
Component Architecture & Lifecycle (GuiComponent)
- Standardized Lifecycle: Added
onAttached(),onDetached(),onDestroy()hooks and per-frame updates viaupdate(float deltaTime). - Percentage Sizing and Positioning:
withPercentWidth(),withPercentHeight(), andwithPercentPosition()dynamically resolved against parent bounds. - Direct Fluent API: Chainable builder methods for position, size, margins, padding, layer ordering (
withLayer), font, and theme directly onGuiComponent. - Reactive State Lifecycle: Automatic unbinding and cleanup of
State<T>listeners upon component destruction to eliminate memory retention.
Visual Components
GuiImage(9-Slice): Native 9-slice border scaling support configured viaNineSliceConfig.GuiSprite: 2D frame animation engine supporting sprite sheets (SpriteSheetSource) and image sequences (SequenceSource) with FPS control and playback loop modes (LoopMode).GuiSlider: Typed modular refactor (GuiSliderInt,GuiSliderFloat,GuiSliderDouble) with full horizontal and vertical orientation support.GuiTextInput: Long text horizontal scrolling, mouse-drag text selection, and word-level navigation/deletion shortcuts (Ctrl+Backspace,Ctrl+Delete).
Non-Intrusive GUI Overlays (GuiOverlayManager)
- Screen Injection: Pipeline to mount X4UI components onto vanilla (
GuiContainer) or third-party screens without replacing the original screen class. - Docking Engine (
OverlayDockManager): Border anchoring (ContainerAnchor) with collision-free multi-panel stacking.
JEI (Just Enough Items) Integration
- JEI Compatibility: Automatic registration of exclusion areas for active X4UI containers and overlays, preventing visual overlap with the JEI item grid.
- Interaction: Support for recipe (
R) and usage (U) lookup hotkeys overGuiSlotcomponents.
Global Buses & Registries
UIStateBus: Decoupled central bus for reactive state and event communication between independent UI modules.ThemeRegistry: Centralized registry to store, look up, and switchIThemeinstances across mods.
Sidedness & Network Architecture
- Proxy Sidedness Separation (@SidedProxy): Strict separation into
ClientProxyandCommonProxy, preventing client, rendering, and media classes from loading on dedicated servers. - Server-Optional Handshake (@NetworkCheckHandler): Asymmetric network handshake allowing clients with X4UI to connect to vanilla and modded servers without requiring X4UI on the server.
Multimedia & Zero-Copy Video/Audio Playback
- Zero-Copy Video Streaming (FFmpeg): Raw video frames streamed directly from OS pipes into off-heap direct buffers (
DirectByteBuffer) via NIO channels (ReadableByteChannel). - JVM Heap Allocation Elimination: Removed intermediate
byte[]heap arrays,asIntBuffer()conversions, andDynamicTextureheap arrays, keeping steady-state Java Heap consumption completely flat during video playback. - Direct OpenGL Texture Upload: Direct DMA-like upload of off-heap buffers into OpenGL VRAM textures via
glTexSubImage2Dwith direct native memory pointers. - VRAM Noise & Glitch Elimination: Added first-frame synchronization latch (
hasUploadedFirstFrame) preventing uninitialized VRAM display before the first decoded frame is uploaded. - Synchronized OpenAL Audio:
OpenALAudioSinkandFFmpegAudioDecoderstreaming 48 kHz stereo PCM audio with real-time volume, mute controls, and master clock synchronization. - Video Controls Overlay (
IVideoControlsLayout): Modular overlay abstraction forGuiVideo. IncludesDefaultVideoControlsLayoutfeaturing Play/Pause toggling, interactive timeline seekbar (mouse scrub/drag, buffer track, time tooltip), formatted timestamps (00:15 / 02:45), mute toggle, and smooth 2.5s auto-hide fade on hover inactivity. - Unified Media Pipeline (
MediaPipeline): Sequential background downloading (1-by-1) and optimization using pinned official FFmpeg inx4ui/bin/(zero hostPATHqueries). Universal recoding to strict JCodec specification:H.264 Baseline Level 3.1(no B-frames, fast CAVLC entropy,yuv420p, even dimensionsscale/pad <= 720p), AAC 48 kHz audio, and MP4 container with faststart (+faststart). Ensures that if native FFmpeg fails or is unavailable at runtime, the pure-JavaJCodecVideoDecoderfallback plays the video smoothly without codec errors. - Declarative Media Manifests: Automatic discovery during
preInitviaassets/<modid>/x4ui/media.jsonand batch registration viaMediaRegistry.registerMedia(), avoiding individual one-by-one registration. - Forge SplashScreen Integration (
ProgressManager): Native progress bar tracking in Forge's loading splashscreen duringloadCompletewith a 35-second safety timeout ensuring dependable game startup. - In-Game Dynamic Loading: Runtime URL playback requests automatically route through
MediaPipelinewith non-blocking download/transcode and an animated loading spinner insideGuiVideo.
Non-Destructive Flexbox Engine (hugContent)
- Default Non-Destructive Sizing:
FlexLayoutno longer destructively overrides or shrinks fixed or percentage-based parent container dimensions (parent.setWidth/setHeight). hugContentProperty: AddedhugContent(boolean)(defaults tofalse). When enabled, automatically resizes the parent container to hug the total bounds of its visible children.- Panel Integration: Fluent
setHugContent()andwithHugContent()methods onGuiPanel. The internal viewport panel ofGuiScrollPanel(contentPanel) now natively enableshugContent(true)to reliably track scrollable content height. - Spacing Polish: Fixed spacing math to eliminate the trailing extra
gapfollowing the last visible flex child.
Video Performance & VRAM Bandwidth Optimization
- OpenGL Texture Upload Caching (
lastUploadedPts): Eliminated redundant off-heap DMA texture transfers (glTexSubImage2D) occurring at 60/144 Hz when the decoded video frame has not changed, slashing PCIe and GPU memory bandwidth usage to the video's actual frame rate (~30 fps). - Direct Buffer Frame Management: Proper
popFrame()integration inDirectMemoryVideoDecoderto guarantee fluid frame consumption and prevent direct memory stalls. - FFmpeg Subprocess Seeking: Implemented responsive seeking in
FFmpegProcessDecodervia-ssprocess restart and accurate frame index recalculation.
Lifecycle & Core Event Pipeline
- Forge EventBus Subscription: Explicitly registered
ClientProxytoMinecraftForge.EVENT_BUSduringinit(), restoring per-frame ticking forGuiAnimator.update()and automatic session cleanup (UIStateBus.clearSessionStates(),GuiAnimator.clearAnimations()) on client disconnection. - Dynamic Text Dimension Propagation:
GuiLabelandGuiMarkdownnow callsetWidth()andsetHeight()instead of mutating fields directly, ensuring layout recalculation (parent.requestLayout()) cascades upward on text updates.
Security, Sandboxing & Remote Asset Network
- Mod ID Cache Sandboxing: Strict per-mod asset isolation under
.minecraft/x4ui/cache/<modid>/, preventing cache collisions between independent mods. - HTTP Network Resilience: Added standard browser
User-Agent, automated HTTP 301/302/307 redirect resolution, and connection timeouts inDownloadManager. - Unified Image Cache: Directed
GuiImage.setUrl()disk cache to.minecraft/x4ui/cache/images/. [/EN]
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:83rsEHHQ:ndWH8TO0"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:83rsEHHQ:ndWH8TO0"
}

