本文整理汇总了Java中com.mumfrey.liteloader.core.runtime.Obf类的典型用法代码示例。如果您正苦于以下问题:Java Obf类的具体用法?Java Obf怎么用?Java Obf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Obf类属于com.mumfrey.liteloader.core.runtime包,在下文中一共展示了Obf类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEnv
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
private int getEnv(Obf obf, String name) {
int env;
if (name.equals(obf.name)) {
// mcp
env = Obf.MCP;
} else if (name.equals(obf.obf)) {
// obf
env = Obf.OBF;
} else if (name.equals(obf.srg)) {
// srg
env = Obf.SRG;
} else {
throw new IllegalArgumentException("Given method name is not in Obf table: " + name);
}
return env;
}
示例2: create
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
public static BLMethodInfo create(String method) {
if (method == null) {
return null;
}
String[] methAndDesc = method.split(Patterns.SPACE);
if (methAndDesc.length < 2) {
throw new IllegalArgumentException("Method ID must contain method name and descriptor separated by a space!");
}
String desc = methAndDesc[1];
String[] nameParts = methAndDesc[0].split(Patterns.PERIOD);
if (nameParts.length < 2) {
throw new IllegalArgumentException("Method name must contain class and method name!");
}
String name = nameParts[nameParts.length - 1];
Obf owner = getObfType(getClassName(nameParts));
return new BLMethodInfo(owner, name, desc);
}
示例3: setupGsonSerialiser
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
@Override
public void setupGsonSerialiser(GsonBuilder gsonBuilder) {
new PrivateFields<GsonBuilder, Excluder>(GsonBuilder.class, new Obf("excluder") {}) {}
.set(gsonBuilder, Excluder.DEFAULT); // grr
gsonBuilder
.registerTypeAdapterFactory(new EnumTypeAdapterFactory())
.registerTypeHierarchyAdapter(Value.class, new ValueSerializer());
}
示例4: hasSuper
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
private boolean hasSuper(ClassNode cn, Obf packet) {
boolean has = false;
String superName = cn.superName;
if (arrayHas(makeRef(packet.names), superName)) {
has = true;
}
return has;
}
示例5: createDescriptor
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
private String createDescriptor(int env, Obf... params) {
StringBuilder strParams = new StringBuilder();
for (Obf obf : params) {
strParams.append(obf.getDescriptor(env));
}
String ret = "V";
return String.format("(%s)%s", strParams.toString(), ret);
}
示例6: getObfType
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
private static Obf getObfType(String name) {
if (!Versions.isGameObfuscated()) {
return BLOBF.getClass(name, OBFLevel.MCP);
}
if (Versions.isForgeInstalled()) {
return BLOBF.getClass(name, OBFLevel.SRG);
}
return BLOBF.getClass(name, OBFLevel.OBF);
}
示例7: PonyFields
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
protected PonyFields(Class<P> owner, Obf obf) {
super(owner, obf);
}
示例8: field
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
private static <P, T> PrivateFields<P, T> field(Class<P> c, Obf o) {
return new PonyFields<>(c, o);
}
示例9: BLMethodInfo
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
private BLMethodInfo(Obf owner, String method, String desc, String simpleName) {
super(owner, method, desc);
this.simpleName = simpleName;
}
示例10: addBLConstructorEvent
import com.mumfrey.liteloader.core.runtime.Obf; //导入依赖的package包/类
protected void addBLConstructorEvent(EventSide side, String clazz, Object[] paramaterTypes, InjectionPoint injectionPoint) {
BLOBF clas = BLOBF.getClass(clazz, OBFLevel.MCP);
String name = clas.simpleName;
addEvent(Event.getOrCreate("BL.<init>." + name, true), new MethodInfo(clas, Obf.constructor, Void.TYPE, paramaterTypes), injectionPoint).addListener(new MethodInfo(side.getHandler(), "init" + capitaliseFirst(name)));
}