mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-23 17:09:19 +00:00
修改库类加载器
This commit is contained in:
@@ -39,12 +39,21 @@ public class PaperCraftEngineBootstrap implements PluginBootstrap {
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException("Failed to getLogger", e);
|
||||
}
|
||||
this.plugin = new BukkitCraftEngine(
|
||||
logger,
|
||||
context.getDataDirectory(),
|
||||
new BukkitClassPathAppender(),
|
||||
new PaperPluginClassPathAppender(this.getClass().getClassLoader())
|
||||
);
|
||||
try {
|
||||
this.plugin = new BukkitCraftEngine(
|
||||
logger,
|
||||
context.getDataDirectory(),
|
||||
new BukkitClassPathAppender(),
|
||||
new PaperPluginClassPathAppender(this.getClass().getClassLoader())
|
||||
);
|
||||
} catch (UnsupportedOperationException e) {
|
||||
this.plugin = new BukkitCraftEngine(
|
||||
logger,
|
||||
context.getDataDirectory(),
|
||||
new PaperPluginClassPathAppender(this.getClass().getClassLoader()),
|
||||
new PaperPluginClassPathAppender(this.getClass().getClassLoader())
|
||||
);
|
||||
}
|
||||
this.plugin.applyDependencies();
|
||||
this.plugin.setUpConfig();
|
||||
if (isDatapackDiscoveryAvailable()) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class BukkitClassPathAppender implements ClassPathAppender {
|
||||
if (bukkitClassLoader.getClass().getName().equals("space.vectrix.ignite.launch.ember.EmberClassLoader") && bukkitClassLoader.getParent() instanceof URLClassLoader urlClassLoader) {
|
||||
this.libraryClassLoaderAccess = URLClassLoaderAccess.create(urlClassLoader);
|
||||
} else {
|
||||
this.libraryClassLoaderAccess = null;
|
||||
throw new UnsupportedOperationException("Unsupported classloader " + bukkitClassLoader.getClass());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user