介绍
A small library built as a Quilt mod which gives modders access to Unsafe (both the sun one and the jdk internal one, assuming it’s exported at compile time) and easily supports runtime module exporting and trusted MethodHandles.Lookup calls.
Current features
Unsafe.sun()for asun.misc.UnsafeinstanceUnsafe.jdk()for ajdk.internal.misc.Unsafeinstance (needs export — see below)Unsafe.lookup()for the trustedMethodHandles.Lookupinstance- Field getting and setting with force
- Enum widening
- Function accessor for allowing runtime use of JDK’s internal ASM copy
- Shortcut methods for getting
MethodHandleinstances through the trusted lookup - Runtime module exporting / opening
- Forceful SecurityManager setting
Exporting modules
At runtime, call ModuleWidener.exportModule with either a class in the requested package, a class in the module and a string of the package, or the module instance and a string of the package.
At compile time, use javac compile arguments:
tasks.withType(JavaCompile).configureEach {
it.options.compilerArgs << "addExports" << "TheModuleGoesHere/ThePackageToExport=ALL-UNNAMED"
// This cannot be used with the release field. Instead use source / target compatibility fields in the java object.
}
常见问题
Dirty Quilt Hacks 支持哪些 Minecraft 版本?
Dirty Quilt Hacks 支持 Minecraft Java 版 1.17–1.19.1,共 7 个版本,可用的加载器:Fabric / Forge / Quilt。下载时注意选择和你游戏版本一致的文件。
Dirty Quilt Hacks 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
sschr15 的其他作品
查看全部 →Quilt Kotlin Libraries (QKL)
Quilt 官方 Kotlin 前置库
Conflict in Harmony Backported
允许在部分旧版 Forge 中使用冲突的按键绑定
Version Mod Loader
根据 Minecraft 版本,从文件夹加载 Fabric 模组
No Double Tap Sprint
禁用双击前进疾跑机制(可在选项中切换)。
评论
登录后评论和评分