mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 21:15:53 +08:00
Refactor: Compatible with JuiceAgent V3.0 b2
This commit is contained in:
1 parent
f0ebdea5ed
commit
42eaee6040
10 files changed
+10
-9
No files matched your search
@@ -4,7 +4,7 @@ import cn.xiaozhou233.orangex.mixin.impl.MixinEntityRenderer;
|
||||
import cn.xiaozhou233.orangex.mixin.impl.MixinGuiIngame;
|
||||
import cn.xiaozhou233.orangex.mixin.impl.MixinMinecraft;
|
||||
import cn.xiaozhou233.orangex.mixin.impl.MixinNetHandlerPlayClient;
|
||||
import cn.xiaozhou233.orangex.utils.JuiceLoaderFacade;
|
||||
import cn.xiaozhou233.orangex.utils.JuiceAgentFacade;
|
||||
import cn.yapeteam.ymixin.Transformer;
|
||||
import cn.yapeteam.ymixin.YMixin;
|
||||
|
||||
@@ -27,7 +27,7 @@ public final class MixinManager {
|
||||
}
|
||||
},
|
||||
clazz -> {
|
||||
byte[] classBytes = JuiceLoaderFacade.getClassBytes(clazz);
|
||||
byte[] classBytes = JuiceAgentFacade.getClassBytes(clazz);
|
||||
if (classBytes == null) {
|
||||
throw new RuntimeException(
|
||||
"ClassBytes null: " + clazz.getName()
|
||||
@@ -53,7 +53,7 @@ public final class MixinManager {
|
||||
transformer.transform().forEach((name, bytes) -> {
|
||||
try {
|
||||
Class<?> targetClass = Class.forName(name, false, cl);
|
||||
boolean ok = JuiceLoaderFacade.redefineClass(targetClass, bytes);
|
||||
boolean ok = JuiceAgentFacade.redefineClass(targetClass, bytes);
|
||||
if (!ok) {
|
||||
throw new RuntimeException("Redefine failed: " + name);
|
||||
}
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ package cn.xiaozhou233.orangex.utils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public final class JuiceLoaderFacade {
|
||||
public final class JuiceAgentFacade {
|
||||
|
||||
private static final Class<?> JL;
|
||||
private static final Method INIT;
|
||||
@@ -13,7 +13,7 @@ public final class JuiceLoaderFacade {
|
||||
static {
|
||||
try {
|
||||
JL = Class.forName(
|
||||
"cn.xiaozhou233.juiceloader.JuiceLoader",
|
||||
"cn.xiaozhou233.juiceagent.api.JuiceAgent",
|
||||
true,
|
||||
ClassLoader.getSystemClassLoader()
|
||||
);
|
||||
@@ -33,7 +33,7 @@ public final class JuiceLoaderFacade {
|
||||
}
|
||||
}
|
||||
|
||||
private JuiceLoaderFacade() {}
|
||||
private JuiceAgentFacade() {}
|
||||
|
||||
public static byte[] getClassBytes(Class<?> clazz) {
|
||||
try {
|
||||
Reference in new issue
Block a user