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) {
|
} catch (ReflectiveOperationException e) {
|
||||||
throw new RuntimeException("Failed to getLogger", e);
|
throw new RuntimeException("Failed to getLogger", e);
|
||||||
}
|
}
|
||||||
this.plugin = new BukkitCraftEngine(
|
try {
|
||||||
logger,
|
this.plugin = new BukkitCraftEngine(
|
||||||
context.getDataDirectory(),
|
logger,
|
||||||
new BukkitClassPathAppender(),
|
context.getDataDirectory(),
|
||||||
new PaperPluginClassPathAppender(this.getClass().getClassLoader())
|
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.applyDependencies();
|
||||||
this.plugin.setUpConfig();
|
this.plugin.setUpConfig();
|
||||||
if (isDatapackDiscoveryAvailable()) {
|
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) {
|
if (bukkitClassLoader.getClass().getName().equals("space.vectrix.ignite.launch.ember.EmberClassLoader") && bukkitClassLoader.getParent() instanceof URLClassLoader urlClassLoader) {
|
||||||
this.libraryClassLoaderAccess = URLClassLoaderAccess.create(urlClassLoader);
|
this.libraryClassLoaderAccess = URLClassLoaderAccess.create(urlClassLoader);
|
||||||
} else {
|
} else {
|
||||||
this.libraryClassLoaderAccess = null;
|
throw new UnsupportedOperationException("Unsupported classloader " + bukkitClassLoader.getClass());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user