如何获得Minecraft class Loader?

发布于 2025-01-28 18:07:06 字数 256 浏览 4 评论 0 原文

我正在为Minecraft JVM加载代理,当我从仪器中获得所有加载类时,大多数都不存在。我的代码看起来像

Class.forName("net.minecraft.client.Minecraft");

,我得到了ClassNotFoundException。我认为这是因为大多数Minecraft类都装在其他类负载器中。对如何获得此类负载器有什么想法?

I'm loading an agent to Minecraft JVM and when I get all the loaded classes from the instrumentation, most of them are not there. My code looks like

Class.forName("net.minecraft.client.Minecraft");

and I get a ClassNotFoundException. I think it is because most of the Minecraft classes are loaded in a different ClassLoader. Any idea of how can I get this ClassLoader?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬色的秋千 2025-02-04 18:07:06

我知道我迟到了,但

我需要使用混淆的名称来使Minecraft

在Minecraft 1.8.9 net.minecraft.client.client.minecraft.minecraft的混淆名称中使用:

Class.forName("ave"); 

而不是

Class.forName("net.minecraft.client.Minecraft");

使用 mcpmappingviewer 找出什么是混淆的名称:)

I know I'm late but

Minecraft is obfuscated You need to use the obfuscated names for this to work

in Minecraft 1.8.9 net.minecraft.client.Minecraft's obfuscated name is ave so you need to use:

Class.forName("ave"); 

instead of

Class.forName("net.minecraft.client.Minecraft");

use MCPMappingViewer to find out what the obfuscated names are :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文