即修改特定函数中instanceof的结果
wiki:https://jenkins.liteloader.com/v ... ction/Redirect.html
其中instanceof Redirect Mode有相关内容,但是没有具体用法
或者是否有其它方案
wiki:https://jenkins.liteloader.com/v ... ction/Redirect.html
其中instanceof Redirect Mode有相关内容,但是没有具体用法
或者是否有其它方案
ASM大法好()
Mixin 的文档一大缺点:你永远不知道你想要的东西的文档写在哪个类里
instanceof 和常量类似,都是通过 LDC 指令把 class 常量入栈,再通过 INSTANCEOF 比较
所以应该用 @At.value 应该填 "CONSTANT"
示例:
复制代码
"CONSTANT" 的文档写在 BeforeConstant 里,里面有一句关键的话:This injection point searches for LDC and other constant opcodes matching its arguments and returns a list of injection points matching those instructions.
instanceof 和常量类似,都是通过 LDC 指令把 class 常量入栈,再通过 INSTANCEOF 比较
所以应该用 @At.value 应该填 "CONSTANT"
示例:
- @Redirect(
- mathod = "xxxx",
- at = @At(
- value = "CONSTANT",
- args = "classValue=com/example/ExcampleClass"
- )
- )
"CONSTANT" 的文档写在 BeforeConstant 里,里面有一句关键的话:This injection point searches for LDC and other constant opcodes matching its arguments and returns a list of injection points matching those instructions.
mixin可以改变量吗?