跳到正文

gudASM

作者:gudenau

ASM hacks for all!

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

gudASM

The ~~worst~~ best thing to happen to Fabric modding.

TL;DR

It allows you to do direct bytecode manipulation and aims to make it "easy". You should only use this when mixins really can’t do what you need.

What can this do?

Anything you want it to, since it allows you to edit classes at the most basic level.

Just be mindful of what classes you load and things should work fine.

Features

  • Raw class transformations
  • A large collection of helper methods
  • @ForceBootstrap and @ForceInline for when you need ~~to break things~~ speed.
  • Custom entry point

How to use

Create a class the implements AsmInitializer and put it in your mod config file as an entrypoint, something like:
JSON
{
...
"entrypoints": {
"gud_asm": [
"com.example.mod.ILikeBreakingThings"
]
},
...
}

Then implement the AsmInitializer.onInitializeAsm() method and do something like this:
“`Java
package com.example.mod;

import net.gudenau.asm.api.v0.AsmInitializer;
import net.gudenau.asm.api.v0.AsmRegistry;

public class ILikeBreakingThings implements AsmInitializer{
@Override
public void onInitializeAsm(){
AsmRegistry.getInstance().registerTransformer(new AmazingTransformer());
}
}
“`

The rest should be pretty straight forward.

Also, please don’t combine AsmInitializer with other initializers. That is just asking for crashes.

常见问题

gudASM 支持哪些 Minecraft 版本?

gudASM 支持 Minecraft Java 版 1.16–1.16.2,共 3 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

gudASM 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

gudenau 的其他作品

查看全部 →