Releases: NilKitAPI/NilKit-API
Releases · NilKitAPI/NilKit-API
Release list
NilKit API v4.1.0
Byte Buddy patching framework
- Expanded the Byte Buddy integration from a thin helper wrapper into a reusable patching framework designed for Mixin-style runtime transformations.
- Added
ByteBuddyPatchas a declarative patch definition API for targeting classes and applying multiple transformations without manually recreatingAgentBuilderor transformer boilerplate. - Added
ByteBuddyPatchRegistryfor managing multiple patches with deterministic ordering and configurable priorities. - Added JVM descriptor-based method matching for more reliable targeting across mapped, obfuscated, and legacy Minecraft environments.
- Added patch validation through
require(...), allowing transformations to fail immediately when an expected method or target is missing instead of silently continuing with an unapplied patch. - Added reusable Advice-based injection support for method entry, method exit, constructors, argument modification, return-value modification, and exception handling.
- Added support for replacing complete method implementations through direct Byte Buddy interception.
- Added low-level transformation access through
mutate(...), allowing patches to use raw Byte Buddy features such asMemberSubstitution, ASM visitors, field/method definitions, implemented interfaces, and custom builder mutations. - Kept the underlying Byte Buddy API exposed so advanced transformations are not restricted by the higher-level NilKit abstraction.
Runtime transformation
- Added optional
Instrumentation-based installation with retransformation support for environments where already-loaded classes must be patched. - Added composition support so multiple independent patches can safely target the same class through a single transformation pipeline.
- Improved transformation diagnostics and failure behavior for incompatible targets, incorrect mappings, and changed method descriptors.
Documentation
- Added documentation and examples for using the Byte Buddy patch API as a Mixin-style transformation layer.
- Documented patch registration, priorities, required targets, Advice injection, full method interception, and advanced raw Byte Buddy mutations.
NilKit API v4.0.0
Legacy v3.0.1
[3.0.1] - 2026-08-05
Compatibility
- Removed the SDK's hard bytecode link to
net.minecraft.client.Minecraft;McHelpernow resolves the mapped Minecraft class lazily through reflection only when Minecraft-specific helpers are called. - Removed the compile-time
game/jarmodMinecraft 1.4.7 dependencies from the SDK build. The core artifact no longer needs a Minecraft JAR to compile. - Removed unused external ASM 9.5 runtime dependencies; transformer helpers already use the loader's shaded ASM API, avoiding unnecessary ASM classpath conflicts in
-all.jar. MinecraftAutoNetworkBridgeno longer assumes Minecraft 1.4.7. When explicitly enabled it reads-D[sdk].minecraft.version=<version>and disables itself safely if the version or mappings are unavailable.- Added regression coverage that rejects hard
net.minecraft.*type references in the Minecraft-facing SDK classes.
Mapping workflow
- Removed the
.remappingstaging workflow.tools/MinecraftRemappingis now the single source path for mapping data. - Gradle mapping generation reads
tools/MinecraftRemapping/<version>/mcp2obf.srgdirectly from the pinned submodule. - Fixed
SimpleRemapso release JARs actually consume the generated mapping subset; 3.0.0 generatedGeneratedSrgMappingsbut never called it. - Replaced
prepareRemapping/import-submodulewith directinspectMinecraftRemapping,inspect-submodule, andsubmodule-pathworkflows. - Updated
gen_srg_mappings.pyto use project-relative paths instead of a machine-specific absolute Windows path.
Build fixes
- Removed duplicate declarations accidentally left in
build.gradle3.0.0 mapping-generation code.
Legacy v2.1.0
[2.1.0] - 2026-08-05
Added
- Added project-local Maven publishing to
./mavenviapublishProjectLocal; publications are OpenPGP-signed with the user's normal GnuPG /gpg-agentsetup. - Added inherited event-listener discovery, typed-listener unregistration, and event-bus clearing APIs.
- Added cooldown remaining-time queries and expired-player cleanup.
- Added NIO client/server state inspection (
isRunning,isConnected, connection snapshots/counts) and server bound-port lookup. - Added default listener hooks for unknown packet IDs and exhausted client reconnect attempts without breaking existing listener implementations.
- Added packet-registry inspection helpers (
isRegistered,size,clear). - Added lifecycle controls/state for the automatic Minecraft network bridge, including explicit
stop()and automatic recovery after reconnect exhaustion. - Added regression tests for KDL, cooldown concurrency, and packet codec/registry behavior.
Changed
- Normal
buildno longer forces loader decompilation;decompileLoaderremains an explicit developer task. - KDL scalar output now uses KDL 2 forms (
#true,#false,#null,#inf,#-inf,#nan). - KDL parsing now accepts common KDL 2 numeric forms, raw strings, quoted property keys, dotted identifiers, nested block comments, and slash-dash node/entry suppression while retaining legacy boolean/null compatibility.
- Event registration is de-duplicated, scans inherited subscriber methods, and preserves deterministic registration order for equal-priority handlers.
- Network listener callback failures are isolated from the selector loop; packet serialization failures no longer disconnect healthy peers.
- Network constructor and packet-registry inputs are validated early with clearer errors.
Fixed
- Fixed
TargetFinderreturning a nearby player that failed the requestedminDotaim threshold and fixed target ranking to prefer alignment with distance as the tie-breaker. - Fixed
CooldownTracker.tryUseGlobal/tryUsePlayerrace conditions so a cooldown window cannot be consumed concurrently by multiple callers. - Fixed entrypoint phase re-entrancy during the pre-dispatch event by installing the active-phase guard before posting the event.
- Fixed NIO server duplicate disconnect callbacks and stale connection entries.
- Fixed NIO client reconnect attempts terminating permanently when opening a replacement channel throws immediately or when a non-blocking connect completes immediately.
- Fixed KDL writer/parser round-trip failures for quoted property keys and KDL 2 scalar values.
- Fixed zero/invalid look-vector and negative-range edge cases in
TargetFinder. - Fixed
ReflectHelper.invokecontradicting its documented null-to-primitive-default behavior. - Fixed automatic network bridge getting stuck with a dead client after reconnect exhaustion.
- Fixed local SRG mapping reads using platform-default encoding and added clearer version validation.
Legacy v2.0.1
[2.0.1] - 2026-04-08
Added
- Added SDK runtime bootstrap for KDL-only mods (archives with
.sdkmod.kdlbut no root*.mod.css). - Added
KdlOnlyModBootstrapperto discover/inject such mods frommods/and[loader]mods/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.1in build and metadata resources. DefaultSdkEntrypointModulenow runs KDL-only bootstrap before dependency enforcement.
Fixed
- Fixed KDL parser newline/block handling in nested sections, resolving
KdlParseExceptionduring valid.sdkmod.kdlparsing. - 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, andentrypointsinstead of fallback?values.
Legacy v2.0.0
[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 the loader's CSS metadata only (*.mod.css). 2.0.0adds SDK KDL metadata (*.sdkmod.kdl) and runtime bridge integration.
- Prior to
- Introduced a general-purpose KDL toolkit for broad SDK usage (not metadata-only):
KdlParser,KdlWriterKdlDocument,KdlNode,KdlValue,KdlParseException- Can be used by any system/module that needs KDL parsing/serialization.
LoaderHelperconvenience 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:
[SDK] - Event primitives:
Event,CancellableEvent,EventPriority,SubscribeEvent - Central
EventBuswith:- annotation listener registration (
@SubscribeEvent) - typed callback registration (
listenstyle) - cancellation-aware dispatch flow
- annotation listener registration (
- Lifecycle events:
PreEntrypointDispatchEvent(cancellable)PhaseEventPostEntrypointDispatchEvent
- Entrypoint dispatcher now emits lifecycle events around phase execution.
ModBasenow includes convenience methods to register/post/listen events.
- Global SDK access point:
- SDK KDL metadata schema expanded with richer mod info fields:
modurlsourceurllicensecredits(multi-value)
Changed
- Bumped SDK version to
2.0.0in build and metadata resources. MetadataBridgenow parses.sdkmod.kdlvia shared KDL parser (KdlParser) instead of manual string parsing for better compatibility.- KDL metadata merge now supports both section blocks (
mod {},entrypoints {}) and top-level fallback keys (name,description,authors,version,entrypoints.<phase>).
Fixed
- Removed inconsistent changelog carry-over for
1.0.4under2.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 loader metadata and dependency-check boilerplate in mods.
- Backward compatibility remains intact: CSS metadata stays primary, and KDL is additive for SDK-aware features.
Legacy v1.0.3
[1.0.3] - 2026-03-26
Changed
- Bumped SDK version to
1.0.3in 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:
SdkModMetadataSdkMetadataKdlSdkMetadataIO
- Runtime metadata bridge in SDK:
MetadataBridgeMetadataPatchInstaller- Patches
Metadata.fromduring premain to merge CSS + KDL automatically.
- New SDK metadata resource source-of-truth:
src/main/resources/[sdk].sdkmod.kdl. LoaderHelperSDK metadata APIs:getSdkMetadata(String)/getSdkMetadata(Metadata)getMissingRequiredMods(String)areRequiredModsLoaded(String)getLoadBefore(String)getLoadAfter(String)getIconPath(String)getLoadedModIcons()getRequiredMods(String)isSafeLoad(String)
Notes
- SDK-only metadata is separated from the loader's base metadata for compatibility.
- SDK metadata default file is now
.sdkmod.kdl(legacy.kdlnames 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
- Missing required mods +
- If SDK is not installed, the base loader still reads only original
*.mod.cssand continues to work normally.
Legacy v1.0.2
[1.0.2] - 2026-03-24
Added
- New helper:
LoaderHelperinme.tamkungz.[sdk].helper. - Convenience APIs for loader metadata and loaded-mod checks:
isModLoaded,isAnyModLoadedgetModMetadata,getModMetadataOrNull,getAllLoadedModsgetLoadedModIds,getLoadedModNames,getLoadedModsByIdgetSourceFile,getEntrypointNames,getEntrypointClass,describeMod
- New helper:
TransformerHelperinme.tamkungz.[sdk].helper. - Java-agent style class patch registration via the loader's transformer pipeline (no Mixin required):
registerBytecodePatchfor raw byte[] transformsregisterAsmPatchfor ASMClassNodetransforms- class-name normalization utilities for internal slash format
Changed
SimpleRemap.forVersion("1.4.7")preserves manual mappings frombuild147()as higher priority.- External SRG (
.remapping/1.4.7/mcp2obf.srg) is used only to fill missing entries, not overwrite existingbuild147()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
GeneratedSrgMappingsfrom local.remapping/*/mcp2obf.srgand 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
.remappingis not bundled in the repository contents.- If you want to build and use remapping locally, prepare/provide your own
.remappingdirectory.
Docs
- README helper section now includes
LoaderHelperand summarizes key API groups. - README now documents class patching usage through
TransformerHelperand phase timing notes (premain/hijack).
Legacy v1.0.1
[1.0.1] - 2026-03-22
Added
- Configurable logging root namespace in
Loggers. - New APIs:
setRoot(String),getRoot(), andresetRoot(). - Per-mod/per-class explicit APIs:
sdk(String),forMod(String),forClass(String, Class<?>), andforModClass(String, Class<?>).
Changed
sdk()andforClass(Class<?>)continue to work with global fallback root.- Multi-mod usage is now supported via explicit-root APIs so roots like
A/...andB/...can coexist. - Logging root defaults to
DEFAULT_ROOTand safely falls back when blank/null is provided.
Legacy v1.0.0
[1.0.0] - 2026-03-22
Added
- Initial public release of the SDK.
- Core SDK base for loader mods via
ModBase. - Entrypoint framework with phase dispatching (
premain,hijack) and recursion safeguards. - Helper utilities for reflection, Minecraft internals, packet handling, and proxy behaviors.
- Utility classes including target resolution and cooldown tracking.
- Java NIO networking stack with client/server, codec, packet registry, and bridge utilities.
- Remapping support through
SimpleRemap. - Standardized logging API through
Loggers. - Example modules and loader metadata resources.
- Maven publishing configuration and source/javadoc artifacts.
Build/Tooling
- Gradle-based build with Java toolchain (Java 8).
- Loader Gradle plugin integration for loader workflows.
- Shadow plugin configured for packaging.
- Optional decompilation task for loader dependency inspection.
Notes
- This is the first changelog entry for the project.