9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

使用modern方案

This commit is contained in:
XiaoMoMi
2025-06-02 17:50:14 +08:00
parent 2fd2323412
commit 31e1dee87d
2 changed files with 5 additions and 5 deletions

View File

@@ -46,15 +46,15 @@ public class PaperCraftEngineBootstrap implements PluginBootstrap {
);
this.plugin.applyDependencies();
this.plugin.setUpConfig();
// if (VersionHelper.isOrAbove1_21_4()) {
// new ModernEventHandler(context, this.plugin).register();
// } else {
if (VersionHelper.isOrAbove1_21_4()) {
new ModernEventHandler(context, this.plugin).register();
} else {
try {
RuntimePatcher.patch(this.plugin);
} catch (Exception e) {
throw new RuntimeException("Failed to patch server", e);
}
// }
}
}
@Override

View File

@@ -8,7 +8,7 @@ import java.lang.instrument.Instrumentation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class BlocksAgent {
public final class BlocksAgent {
public static void agentmain(String args, Instrumentation instrumentation) {
new AgentBuilder.Default()