本文整理汇总了Java中net.minecraftforge.fml.common.asm.transformers.AccessTransformer类的典型用法代码示例。如果您正苦于以下问题:Java AccessTransformer类的具体用法?Java AccessTransformer怎么用?Java AccessTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccessTransformer类属于net.minecraftforge.fml.common.asm.transformers包,在下文中一共展示了AccessTransformer类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: injectAccessTransformer
import net.minecraftforge.fml.common.asm.transformers.AccessTransformer; //导入依赖的package包/类
public static void injectAccessTransformer(File file, String atName, LaunchClassLoader loader) throws IOException {
if (!AlchemyEngine.isRuntimeDeobfuscationEnabled() || file == null)
return;
String at = null;
try (JarFile jar = new JarFile(file)) {
ZipEntry entry = jar.getEntry("META-INF/" + atName);
if (entry != null)
at = Tool.read(jar.getInputStream(entry));
}
if (at != null) {
List<IClassTransformer> transformers = $(loader, "transformers");
for (IClassTransformer t : transformers)
if (t instanceof AccessTransformer) {
AccessTransformer transformer = (AccessTransformer) t;
$(transformer, "processATFile", CharSource.wrap(at));
break;
}
}
}