A high-performance visual toolkit and annotation-driven configuration library. Provides various utilities, event systems, and more.
@ConfigProperty and @Slider automatically produces robust JSON serialization, schema validations, and reactive in-game GUI screens without bespoke boilerplate.MethodHandle calls, achieving a $4\times$ throughput improvement over conventional event buses.package net.silencehub.samplemod.config;
import net.silence.lucent.api.config.annotation.*;
import net.silence.lucent.api.config.type.ColorRGBA;
@Config(id = "sample_mod", name = "Sample Mod Configuration", category = "HUD & Diagnostics")
public class SampleModConfig {
@ConfigProperty(
name = "Master Enable",
description = "Enables the unified Silence vector HUD overlay.",
order = 1
)
public static boolean enabled = true;
@Slider(
name = "HUD Panel Opacity",
description = "Controls background surface alpha transparency (0.0 to 1.0).",
min = 0.0f,
max = 1.0f,
step = 0.05f,
order = 2
)
public static float hudOpacity = 0.85f;
@ColorPicker(
name = "Accent Color",
description = "Hex/RGBA highlight tone applied to telemetry indicators.",
allowAlpha = true,
order = 3
)
public static ColorRGBA primaryColor = new ColorRGBA(30, 107, 255, 255);
@Dropdown(
name = "Anti-Aliasing Preset",
options = {"Fast", "Subpixel Vector", "Ultra MSAA"},
order = 4
)
public static String antiAliasingMode = "Subpixel Vector";
}import net.silence.lucent.api.LucentRegistry;
public class SampleModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
// Registers the config schema with automated AppData synchronization.
LucentRegistry.registerConfig(SampleModConfig.class);
}
}[ Minecraft Render Tick ]
│
▼
[ Lucent Core Hook (Mixin) ]
│
├─► EventStage.PRE_RENDER (Surface and frame buffer prep)
│
├─► NanoVG Context Setup (Vector stencil & canvas bounds)
│ │
│ ├─► Custom HUD Elements (LucentClient)
│ ├─► Registered Mod Widgets
│ └─► Floating Tooltip Layer
│
├─► EventStage.POST_RENDER (GL state restoration)
│
▼
[ Minecraft Framebuffer Swap ]import net.silence.lucent.api.event.LucentRenderEvent;
import net.silence.lucent.api.graphics.NanoContext;
public class CustomWidgetRenderer {
public static void onRender(LucentRenderEvent event) {
NanoContext vg = event.getContext();
// Draw hardware-accelerated rounded card with neon glow
vg.beginPath();
vg.roundedRect(100, 100, 240, 60, 12);
vg.fillColor(SampleModConfig.primaryColor);
vg.fill();
// Crisp typography using embedded vector font engine
vg.fontSize(16.0f);
vg.fontFace("Inter-Bold");
vg.text(120, 135, "Silence Hub Connected");
}
}| Package / Class | Method / Annotation | Purpose |
|---|---|---|
net.silence.lucent.api.config | @Config(id, name) | Declares configuration namespace and display title. |
net.silence.lucent.api.config | @Slider(min, max, step) | Binds numeric properties to interactive range sliders. |
net.silence.lucent.api.config | @ColorPicker(allowAlpha) | Binds RGBA color pickers with hex code input. |
net.silence.lucent.api.graphics | NanoContext.roundedRect() | Draws hardware-accelerated vector geometries. |
net.silence.lucent.api.event | EventBus.subscribe() | Subscribes high-throughput event callback handlers. |
UnsatisfiedLinkError (lwjgl_nanovg.dll).Physical Pixel in configuration to synchronize OpenGL viewport coordinates with native display density.LucentClient.jar, while external developers should reference Lucent via Gradle: compileOnly "net.silence:lucent:2.4.0".