Hello everybody, it's been a while since this plugin has seen some serious update, but here's a big one.
Paper-405 has broken its PluginLoader api completely, causing me to have to reimplement most of ScalaLoader's functionality again in order to support Paper. So that's exactly what I've done for this update.
This update contains the following changes (some of which are breaking for JavaPlugins):
- On Paper-405 and later, ScalaLoader will load as a Paper Plugin.
- ScalaPlugins will be loaded as Paper Plugins as well:
- You can specify your own Bootstrapper if you want. You can use ScalaLoaderUtils#createInstance(Class) to create your plugin instance if your plugin's main class is an object or has a constructor with zero parameters.
- Be aware that the version of Scala your plugin uses is registered with the ScalaCompatMap. Use xyz.janboerman.scalaloader.paper.ScalaLoader#getScalaVersions()#add(ScalaDependency)
- User-specified PluginLoaders will not be supported.
- To make all of this possible, many of the api methods which previously used an instance of ScalaLoader, ScalaPlugin, ScalaPluginLoader or ScalaPluginClassLoader, will now use IScalaLoader, IScalaPlugin, IScalaPluginLoader and IScalaPluginClassLoader. These interfaces have separate implementations for CraftBukkit/Spigot and for Paper/Folia.
- Bytecode transformations are included for compatibility, so that your xyz.janboerman.scalaloader.plugin.ScalaPlugin will be a sublcass of xyz.janboerman.scalaloader.paper.plugin.ScalaPlugin instead at runtime.
- ScalaPluginEnableEvent and ScalaPluginDisableEvent have been deprecated since they can't be properly implemented on Paper. Use regular PluginEnableEvent and PluginDisableEvent instead.
- ScalaPluginLoader#openUpToJavaPlugin has been deprecated since it won't work on Paper. JavaPlugins should therefore no longer call it if IScalaLoader.isPaperPlugin() returns true. There is no alternative provided for Paper since ScalaPlugins on Paper will be subclasses of JavaPlugin, so the regular dependency mechanism suffices (you still have to make sure your JavaPlugin depends on "ScalaLoader" though).
- ScalaPlugin#getClassLoader() has been depcreated. Use IScalaPlugin#classLoader() instead.
- ScalaPluginDescription has seen several additions - you can now specify your Bootstrapper, and you can specify Folia support for your ScalaPlugin. You can also now specify your maven dependencies right from your Scala code. Be aware that those dependencies will not be loaded yet when your plugin's constructor is called!
- Some methods that were already deprecated in the 0.17.x releases have been removed.