Перейти к содержимому
Mineforgian

NilLoaderSDK API

Utilities and helper SDK for NilLoader mod development. The purpose is to make developing older versions of Minecraft easier.

127 загрузок0 подписчиковLGPL-3.0-onlynilloader

Обновлён 8 апреля 2026 г. · опубликован 21 марта 2026 г.

  • Log
  • Logo

NilLoaderSDK

NilLoaderSDK is a Java 8 utility SDK for NilLoader-based Minecraft mods (legacy versions).

It provides:

  • metadata helpers for NilLoader + KDL
  • runtime bootstrap for KDL-only mods
  • reflection/remapping helpers
  • event bus and lifecycle events
  • NIO networking utilities

Why NilLoaderSDK?

NilLoaderSDK is not only metadata tooling. It is a practical utility layer for legacy NilLoader mod development, with reusable APIs that reduce boilerplate and speed up feature development.

Use it when you want a single toolkit for lifecycle dispatching, reflection/remapping, networking, event handling, and modernized metadata support.


Key Features

  • Lifecycle + Entrypoint system
    • premain / hijack dispatching via ServiceLoader, JVM properties, and properties file
    • Default SDK modules for centralized startup flow
  • Event bus for mod architecture
    • Lightweight event system with cancellable events and priority ordering
    • Lifecycle events for pre/post entrypoint dispatch hooks
  • Networking stack (Java NIO)
    • Client/server implementations with packet registry and codec
    • Optional auto-network bridge for fast integration
  • Reflection + remapping helpers
    • Utilities for interacting with obfuscated legacy internals safely and repeatedly
  • Metadata bridge (CSS + KDL)
    • Supports .nilmod.css and .nilsdkmod.kdl
    • KDL-only runtime bootstrap for SDK-aware mods when root CSS is absent
    • Dependency policy support (requires, safeload, load order hints)
  • Diagnostics for pack/mod developers
    • Verbose bootstrap pipeline logs
    • Loaded-mod table output:
      • ID | Name | Version | Authors | License

Metadata Example (.nilsdkmod.kdl)

nilmod {
  name "My Mod"
  description "Example mod"
  authors "Author"
  version "1.0.0"
}

entrypoints {
  premain "com.example.MyPremain"
  hijack "com.example.MyHijack"
}

nilloadersdk {
  requires "nilloader" "nilloadersdk"
  load_after "nilloadersdk"
  icon "assets/mymod/icon.png"
  modurl "https://modrinth.com/mod/my-mod"
  sourceurl "https://github.com/example/my-mod"
  license "MIT"
  credits "Author"
}

Dependency (Gradle)

repositories {
  maven { url "https://repo.tamkungz.me" }
}

dependencies {
  implementation "me.tamkungz.nilloadersdk:nilloadersdk:2.0.1"
}

Repository: https://repo.tamkungz.me


Keywords (for search)

NilLoader, NilLoaderSDK, Minecraft 1.4.7, legacy Minecraft modding, Java 8 modding, entrypoint framework, event bus, NIO networking, reflection helper, remapping tools, KDL metadata, nilmod SDK.


License

Licensed under LGPL-3.0-or-later.


Credits

Версии

ВерсияКаналИграЗагрузчикиДатаСкачать
2.0.1Релиз1.7.7, 1.7.8, 1.7.9, 1.7.10nilloader8 апреля 2026 г..jar (278 КБ)
2.0.0Релиз1.7.7, 1.7.8, 1.7.9, 1.7.10nilloader8 апреля 2026 г..jar (267 КБ)
1.0.3Релиз1.4.7, 1.5.2, 1.6.2, 1.6.4nilloader6 апреля 2026 г..jar (240 КБ)
1.0.2Релиз1.4.7, 1.5.2, 1.6.2, 1.6.4nilloader23 марта 2026 г..jar (70 КБ)
1.0.1Релиз1.4.7nilloader21 марта 2026 г..jar (63 КБ)
1.0.0Релиз1.4.7nilloader21 марта 2026 г..jar (62 КБ)

Ченджлог

2.0.1Релиз1.7.8, 1.7.9, 1.7.10 · 8 апреля 2026 г.

CHANGE

All notable changes to this project will be documented in this file.

[2.0.1] - 2026-04-08

Added

  • Added SDK runtime bootstrap for KDL-only mods (archives with .nilsdkmod.kdl but no root *.nilmod.css).
  • Added KdlOnlyModBootstrapper to discover/inject such mods from mods/ and nilmods/ during SDK premain.
  • Added verbose bootstrap diagnostics for KDL-only loading flow (candidate scan, KDL entry detection, metadata parse status, classpath injection, premain invocation).
  • Added formatted loaded-mod summary table log:
    • ID | Name | Version | Authors | License

Changed

  • Bumped SDK version to 2.0.1 in build and metadata resources.
  • DefaultSdkEntrypointModule now runs KDL-only bootstrap before dependency enforcement.

Fixed

  • Fixed KDL parser newline/block handling in nested sections, resolving KdlParseException during valid .nilsdkmod.kdl parsing.
  • Improved metadata text decoding for runtime reads (UTF-8/UTF-16 BOM and UTF-16 heuristic fallback) in bridge and SDK metadata IO.
  • Fixed KDL-only metadata resolution so injected mods now correctly expose name, version, and entrypoints instead of fallback ? values.
2.0.0Релиз1.7.8, 1.7.9, 1.7.10 · 8 апреля 2026 г.

CHANGE

All notable changes to this project will be documented in this file.

[2.0.0] - 2026-04-08

Added

  • Introduced KDL support as a first-class metadata layer in 2.0.0.
    • Prior to 2.0.0, mods relied on NilLoader CSS metadata only (*.nilmod.css).
    • 2.0.0 adds SDK KDL metadata (*.nilsdkmod.kdl) and runtime bridge integration.
  • Introduced a general-purpose KDL toolkit for broad SDK usage (not metadata-only):
    • KdlParser, KdlWriter
    • KdlDocument, KdlNode, KdlValue, KdlParseException
    • Can be used by any system/module that needs KDL parsing/serialization.
  • NilLoaderHelper convenience APIs for easier multi-mod integration and diagnostics:
    • isAllModsLoaded(String...)
    • getFirstLoadedMod(String...)
    • getEntrypoints(String)
    • hasEntrypoint(String, String)
    • getModsWithEntrypoint(String)
    • hasMissingRequiredMods(String)
    • getMissingRequiredModsForLoadedMods()
    • getModsRequiring(String)
  • Forge/Fabric-like event architecture for easier mod development:
    • Global SDK access point: NilLoaderSDK
    • Event primitives: Event, CancellableEvent, EventPriority, SubscribeEvent
    • Central EventBus with:
      • annotation listener registration (@SubscribeEvent)
      • typed callback registration (listen style)
      • cancellation-aware dispatch flow
    • Lifecycle events:
      • PreEntrypointDispatchEvent (cancellable)
      • PhaseEvent
      • PostEntrypointDispatchEvent
    • Entrypoint dispatcher now emits lifecycle events around phase execution.
    • NilModBase now includes convenience methods to register/post/listen events.
  • SDK KDL metadata schema expanded with richer mod info fields:
    • modurl
    • sourceurl
    • license
    • credits (multi-value)

Changed

  • Bumped SDK version to 2.0.0 in build and metadata resources.
  • NilMetadataBridge now parses .nilsdkmod.kdl via shared KDL parser (KdlParser) instead of manual string parsing for better compatibility.
  • KDL metadata merge now supports both section blocks (nilmod {}, entrypoints {}) and top-level fallback keys (name, description, authors, version, entrypoints.<phase>).

Fixed

  • Removed inconsistent changelog carry-over for 1.0.4 under 2.0.0.

Notes

  • New helper methods are Java 8 compatible and return immutable collections where applicable.
  • Focus of this update is DX (developer experience): reduce repetitive NilLoader metadata and dependency-check boilerplate in mods.
  • Backward compatibility remains intact: CSS metadata stays primary, and KDL is additive for SDK-aware features.
1.0.3Релиз1.5.2, 1.6.2, 1.6.4 · 6 апреля 2026 г.

CHANGE

All notable changes to this project will be documented in this file.

[1.0.3] - 2026-03-26

Changed

  • Bumped SDK version to 1.0.3 in build and metadata resources.
  • KDL metadata parser remains custom/in-project (Java 8 compatible), without external KDL dependency.

Added

  • SDK-only metadata model and IO:
    • SdkModMetadata
    • SdkMetadataKdl
    • SdkMetadataIO
  • Runtime metadata bridge in SDK:
    • NilMetadataBridge
    • NilMetadataPatchInstaller
    • Patches NilMetadata.from during premain to merge CSS + KDL automatically.
  • New SDK metadata resource source-of-truth: src/main/resources/nilloadersdk.nilsdkmod.kdl.
  • NilLoaderHelper SDK metadata APIs:
    • getSdkMetadata(String) / getSdkMetadata(NilMetadata)
    • getMissingRequiredMods(String)
    • areRequiredModsLoaded(String)
    • getLoadBefore(String)
    • getLoadAfter(String)
    • getIconPath(String)
    • getLoadedModIcons()
    • getRequiredMods(String)
    • isSafeLoad(String)

Notes

  • SDK-only metadata is separated from NilLoader base metadata for compatibility.
  • SDK metadata default file is now .nilsdkmod.kdl (legacy .kdl names are still readable).
  • Merge policy: CSS is primary; KDL only fills missing metadata fields.
  • No per-mod custom Gradle metadata-generation step required.
  • Dependency enforcement:
    • Missing required mods + safeload=true -> warn log
    • Missing required mods + safeload=false -> error and stop startup
  • If SDK is not installed, NilLoader still reads only original *.nilmod.css and continues to work normally.
1.0.2Релиз1.5.2, 1.6.2, 1.6.4 · 23 марта 2026 г.

CHANGE

All notable changes to this project will be documented in this file.

[1.0.2] - 2026-03-24

Added

  • New helper: NilLoaderHelper in me.tamkungz.nilloadersdk.helper.
  • Convenience APIs for NilLoader metadata and loaded-mod checks:
    • isModLoaded, isAnyModLoaded
    • getModMetadata, getModMetadataOrNull, getAllLoadedMods
    • getLoadedModIds, getLoadedModNames, getLoadedModsById
    • getSourceFile, getEntrypointNames, getEntrypointClass, describeMod
  • New helper: TransformerHelper in me.tamkungz.nilloadersdk.helper.
  • Java-agent style class patch registration via NilLoader transformer pipeline (no Mixin required):
    • registerBytecodePatch for raw byte[] transforms
    • registerAsmPatch for ASM ClassNode transforms
    • class-name normalization utilities for internal slash format

Changed

  • SimpleRemap.forVersion("1.4.7") preserves manual mappings from build147() as higher priority.
  • External SRG (.remapping/1.4.7/mcp2obf.srg) is used only to fill missing entries, not overwrite existing build147() mappings.
  • SimpleRemap.forVersion(version) can load remap for versions that provide local .remapping/<version>/mcp2obf.srg.

Packaging

  • SRG files are not bundled into the built JAR.
  • Build now auto-generates GeneratedSrgMappings from local .remapping/*/mcp2obf.srg and embeds only the extracted mappings used by SDK remap calls.
  • Runtime loads generated mappings first via SimpleRemap, then keeps fallback behavior for local development.

Notes

  • .remapping is not bundled in the repository contents.
  • If you want to build and use remapping locally, prepare/provide your own .remapping directory.

Docs

  • README helper section now includes NilLoaderHelper and summarizes key API groups.
  • README now documents class patching usage through TransformerHelper and phase timing notes (premain / hijack).
1.0.1Релиз1.4.7 · 21 марта 2026 г.

CHANGE

All notable changes to this project will be documented in this file.

[1.0.1] - 2026-03-22

Added

  • Configurable logging root namespace in Loggers.
  • New APIs: setRoot(String), getRoot(), and resetRoot().
  • Per-mod/per-class explicit APIs: sdk(String), forMod(String), forClass(String, Class<?>), and forModClass(String, Class<?>).

Changed

  • sdk() and forClass(Class<?>) continue to work with global fallback root.
  • Multi-mod usage is now supported via explicit-root APIs so roots like A/... and B/... can coexist.
  • Logging root defaults to DEFAULT_ROOT and safely falls back when blank/null is provided.

Полная история изменений — на Modrinth.

Комментарии

Загружаем…