NilKit API
作者:rebot | 分类:模组
Minecraft 版本: 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.1 1.3.2 1.4.2 1.4.4 1.4.5 1.4.6 1.4.7 1.5.1 1.5.2 1.6.1 1.6.2 1.6.4 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.7.10 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.10 1.10.1 1.10.2 1.11 1.11.1 1.11.2 1.12 1.12.1 1.12.2 1.13 1.13.1 1.13.2 1.14 1.14.1 1.14.2 1.14.3 1.14.4 1.15 1.15.1 1.15.2 1.16 1.16.1 1.16.2 1.16.3 1.16.4 1.16.5 1.17 1.17.1 1.18 1.18.1 1.18.2 1.19 1.19.1 1.19.2 1.19.3 1.19.4 1.20 1.20.1 1.20.2 1.20.3 1.20.4 1.20.5 1.20.6 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.21.6 1.21.7 1.21.8 1.21.9 1.21.10 1.21.11 26.1 26.1.1 26.1.2
平台: nilloader
标签: library utility
NilKit API
An independent utility API and developer toolkit for mods built with NilLoader.
Important
NilKit is not part of the official NilLoader project and is not required to use NilLoader.
NilLoader is maintained separately at:
https://git.sleeping.town/Nil/NilLoader
NilKit provides reusable APIs and tooling for legacy Minecraft mod development, with a focus on reducing boilerplate around events, reflection, mappings, metadata, networking, and development utilities.
NilKit 4.1.0 targets Java 8 bytecode and does not require a hard runtime link to a specific Minecraft JAR for its core APIs. Minecraft-specific functionality remains dependent on the mappings and structure of the target game version.
Features
Events and lifecycle
- Lightweight event bus
- Cancellable events
- Listener priorities
premain/hijacklifecycle helpers- Typed and annotation-based listeners
Reflection and legacy Minecraft tooling
- Reflection helpers for version-dependent Minecraft code
- SRG/CSRG mapping utilities
- Mapping inspection, reversal, chaining, and lookup
- Integration with the external
MinecraftRemappingmapping repository during development
KDL
NilKit includes a general-purpose KDL parser and writer and can use KDL for richer project/mod metadata.
KDL support is optional. NilKit does not require NilLoader mods to use KDL, and standard NilLoader metadata remains fully supported.
Example:
nilmod {
name "My Mod"
description "Example mod"
authors "Author"
version "1.0.0"
}
entrypoints {
premain "com.example.MyPremain"
hijack "com.example.MyHijack"
}
nilkit {
requires "nilloader" "nilkit"
load_after "nilkit"
icon "assets/mymod/icon.png"
modurl "https://modrinth.com/mod/my-mod"
sourceurl "https://github.com/example/my-mod"
license "MIT"
credits "Author"
}
Networking
- Java NIO client/server utilities
- Packet registry and codecs
- Optional Minecraft-facing network helpers
Developer toolbox
The optional -all.jar also bundles several developer libraries without relocating their public packages:
- Byte Buddy
- GEB
- ClassGraph
- SnakeYAML
The normal NilKit artifact does not require these libraries at runtime.
Gradle
repositories {
maven {
url = uri("https://repo.tamkungz.me")
}
}
dependencies {
implementation "me.tamkungz.nilkit:nilkit:4.1.0"
}
Documentation
Full documentation and development information are available in the GitHub repository:
https://github.com/NilKitAPI/NilKit-API/tree/main/docs
NilLoader
NilKit is designed to complement NilLoader, not replace it.
NilLoader itself, its loading lifecycle, and its upstream development remain separate from NilKit.
License
NilKit is licensed under LGPL-3.0-or-later.
请登录后举报
暂无评论,抢个沙发吧~