MCPcopy Index your code
hub / github.com/Low-Drag-MC/LDLib2

github.com/Low-Drag-MC/LDLib2 @v26.1.2.24

Chat with this repo
repository ↗ · DeepWiki ↗ · release v26.1.2.24 ↗ · + Follow
9,567 symbols 38,112 edges 1,056 files 1,807 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LDLib2

A modern Minecraft modding library for UI, rendering, synchronization, persistence, and in-game editors.

GitHub stars CurseForge downloads Modrinth downloads Latest Maven version NeoForge License

Documentation | Java Integration | UI Guide | Discord | CurseForge | Modrinth


LDLib2 is a complete rewrite of the original LDLib, redesigned around modern Minecraft and NeoForge development. It gives mod authors a higher-level foundation for building complex UI, visual tools, renderer-backed content, synchronized data, and persistent runtime systems without rebuilding the same infrastructure in every project.

The 2.x line focuses heavily on developer experience: a modern layout engine, CSS-like styling, data binding, RPC events, plug-and-play UI components, XML UI definitions, and an in-game visual editor.

Watch the UI Showcase

LDLib2 UI showcase

Why LDLib2?

  • Modern UI system: build screens with a Taffy-powered layout model, flexible event handling, and reusable components.
  • LSS stylesheets: describe layout and visuals with a CSS-like stylesheet system instead of scattering style code everywhere.
  • Data binding + RPC events: connect client UI state with server-side logic using built-in synchronization patterns.
  • Visual UI editor: design and iterate on UI in game, then load layouts from XML or wire them up from Java/KubeJS.
  • Rendering infrastructure: shader, texture, model rendering, scene, and editor utilities for advanced visual mods.
  • Sync and persistence: annotation-driven data synchronization and persisted parsing for block entities and runtime data.
  • Ecosystem integration: built-in support patterns for JEI, REI, EMI, KubeJS, and other common modding workflows.

Core Modules

Module What it is for
LDLib2 UI Modular UI, layout, events, styling, XML, editor, components, HUD overlays
Synchronization and Persistence Data sync, persisted parsing, RPC packets, and managed block entities
Rendering Shaders, textures, model rendering, scenes, and visual editor infrastructure
Integrations XEI recipe viewer support, KubeJS hooks, Java plugin entry points

Java Integration

LDLib2 is published to the FirstDark Maven snapshots repository.

repositories {
    maven { url = "https://maven.firstdark.dev/snapshots" }
}

dependencies {
    implementation("com.lowdragmc.ldlib2:ldlib2-neoforge-${minecraft_version}:${ldlib2_version}:all")
}

For LDLib2 versions before 2.2.1, disable transitive dependencies and add Yoga manually:

dependencies {
    implementation("com.lowdragmc.ldlib2:ldlib2-neoforge-${minecraft_version}:${ldlib2_version}:all") {
        transitive = false
    }
    compileOnly("org.appliedenergistics.yoga:yoga:1.0.0")
}

Recommended project variables:

minecraft_version=1.21.1
ldlib2_version=2.2.6

LDLib Plugin Entry Point

Create a plugin class when your mod needs to register LDLib2 resources, integrations, or startup hooks.

import com.lowdragmc.lowdraglib2.plugin.ILDLibPlugin;
import com.lowdragmc.lowdraglib2.plugin.LDLibPlugin;

@LDLibPlugin
public class MyLDLibPlugin implements ILDLibPlugin {
    @Override
    public void onLoad() {
        // Register LDLib2 extensions here.
    }
}

Quick UI Example

This creates a small ModularUI with a label, a button, and a styled root element.

import com.lowdragmc.lowdraglib2.gui.holder.ModularUIScreen;
import com.lowdragmc.lowdraglib2.gui.ui.ModularUI;
import com.lowdragmc.lowdraglib2.gui.ui.UI;
import com.lowdragmc.lowdraglib2.gui.ui.UIElement;
import com.lowdragmc.lowdraglib2.gui.ui.elements.Button;
import com.lowdragmc.lowdraglib2.gui.ui.elements.Label;
import com.lowdragmc.lowdraglib2.gui.ui.styletemplate.Sprites;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;

public class MyScreenUi {
    public static ModularUI createUi() {
        var root = new UIElement()
                .layout(layout -> layout.paddingAll(7).gapAll(5))
                .style(style -> style.background(Sprites.BORDER));

        root.addChildren(
                new Label().setText("My First LDLib2 UI"),
                new Button()
                        .setText("Click Me")
                        .setOnClick(event -> {
                            // Handle the click here.
                        })
        );

        return ModularUI.of(UI.of(root));
    }

    public static void open() {
        Minecraft.getInstance().setScreen(
                new ModularUIScreen(createUi(), Component.empty())
        );
    }
}

For a full walkthrough, see the UI Getting Started guide.

Developer Tools

If you develop with LDLib2, install the LDLib Dev Tool IDEA plugin for editor assistance around LDLib2-specific files and annotations. The Java Integration guide covers code highlighting, syntax checks, jump-to-definition, autocomplete, and annotation support.

Migrating from LDLib

LDLib2 is not a small patch over LDLib. It removes old systems and rebuilds the core architecture for Minecraft 1.21+.

  • Legacy UI and outdated framework pieces have been removed.
  • UI layout, styling, events, and data flow have been redesigned.
  • Documentation and examples are written around the new architecture.
  • Compatibility work focuses on modern NeoForge and current modding integrations.

Links

License

LDLib2 is licensed under the LGPL-3.0 license.

Extension points exported contracts — how you extend this code

IHasContextualMenuItems (Interface)
Interface for models that provide contextual menu items. [7 implementers]
src/main/java/com/lowdragmc/lowdraglib2/nodegraphtookit/model/IHasContextualMenuItems.java
IFluidHandlerModifiable (Interface)
Extensions to NeoForge's IFluidHandler [10 implementers]
src/main/java/com/lowdragmc/lowdraglib2/misc/IFluidHandlerModifiable.java
ITickable (Interface)
The ITickable interface represents an entity that performs a periodic action at regular intervals or upon invoca [10 implementers]
src/main/java/com/lowdragmc/lowdraglib2/gui/util/ITickable.java
IConfiguratorAccessor (Interface)
@author KilaBash @date 2022/12/1 @implNote IConfiguratorAccessor [6 implementers]
src/main/java/com/lowdragmc/lowdraglib2/configurator/accessors/IConfiguratorAccessor.java
IPersistedSerializable (Interface)
Class with this interface can serialize and deserialize itself by detecting fields with Persisted and {@link Con [16 implementers]
src/main/java/com/lowdragmc/lowdraglib2/syncdata/IPersistedSerializable.java

Core symbols most depended-on inside this repo

get
called by 795
src/main/java/com/lowdragmc/lowdraglib2/registry/LDLRegistry.java
layout
called by 575
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/UIElement.java
getValue
called by 359
src/main/java/com/lowdragmc/lowdraglib2/gui/sync/bindings/IDataSource.java
getLayout
called by 343
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/UIElement.java
size
called by 320
src/main/java/com/lowdragmc/lowdraglib2/utils/IdentityMap.java
addClass
called by 315
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/UIElement.java
set
called by 314
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/elements/StructuredTagEditor.java
of
called by 311
src/main/java/com/lowdragmc/lowdraglib2/gui/texture/GuiTexture.java

Shape

Method 7,984
Class 1,095
Function 247
Interface 183
Enum 58

Languages

Java93%
Kotlin7%

Modules by API surface

src/main/java/com/lowdragmc/lowdraglib2/gui/ui/UIElement.java176 symbols
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/style/LayoutStyle.java165 symbols
src/main/java/com/lowdragmc/lowdraglib2/nodegraphtookit/model/graph/GraphModel.java146 symbols
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/elements/TextArea.java113 symbols
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/elements/TextField.java88 symbols
src/main/java/com/lowdragmc/lowdraglib2/client/scene/WorldSceneRenderer.java81 symbols
src/main/java/com/lowdragmc/lowdraglib2/nodegraphtookit/gui/GraphView.java80 symbols
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/layout/TaffyLayoutStyle.dsl.kt69 symbols
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/layout/TaffyLayoutStyle.java68 symbols
src/main/java/com/lowdragmc/lowdraglib2/utils/virtuallevel/DummyWorld.java64 symbols
src/main/java/com/lowdragmc/lowdraglib2/gui/ui/elements/StructuredTagEditor.java62 symbols
src/main/java/com/lowdragmc/lowdraglib2/nodegraphtookit/model/node/PortModel.java57 symbols

For agents

$ claude mcp add LDLib2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact