Class ScalaLoader

All Implemented Interfaces:
CommandExecutor, TabCompleter, TabExecutor, Plugin, xyz.janboerman.scalaloader.compat.IScalaLoader

public final class ScalaLoader extends JavaPlugin implements xyz.janboerman.scalaloader.compat.IScalaLoader

The ScalaLoader plugin's main class! ScalaLoader enables you to write plugins in Scala. Just depend on ScalaLoader, extend ScalaPlugin, and ScalaLoader will provide the Scala runtime classes!

If you want to explicitly get the instance of the ScalaLoader plugin, use IScalaLoader.getInstance() instead. The implementation of ScalaLoader returned by this method depends on whether ScalaLoader is loaded as Paper Plugin or not.

Author:
Jannyboy11
Note:
undocumented methods are unintended for use outside of this plugin.
  • Constructor Details

    • ScalaLoader

      public ScalaLoader()
  • Method Details

    • isPaperPlugin

      public boolean isPaperPlugin()
      Specified by:
      isPaperPlugin in interface xyz.janboerman.scalaloader.compat.IScalaLoader
    • getDebugSettings

      public xyz.janboerman.scalaloader.DebugSettings getDebugSettings()
      Specified by:
      getDebugSettings in interface xyz.janboerman.scalaloader.compat.IScalaLoader
    • getScalaPluginsFolder

      public File getScalaPluginsFolder()
      Specified by:
      getScalaPluginsFolder in interface xyz.janboerman.scalaloader.compat.IScalaLoader
    • getScalaPlugins

      public Collection<ScalaPlugin> getScalaPlugins()
      Specified by:
      getScalaPlugins in interface xyz.janboerman.scalaloader.compat.IScalaLoader
    • getEventBus

      public xyz.janboerman.scalaloader.event.EventBus getEventBus()
      Specified by:
      getEventBus in interface xyz.janboerman.scalaloader.compat.IScalaLoader
    • getJavaPluginLoaderPatterns

      public Pattern[] getJavaPluginLoaderPatterns()
    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface Plugin
      Overrides:
      onLoad in class JavaPlugin
    • onEnable

      public void onEnable()
      Specified by:
      onEnable in interface Plugin
      Overrides:
      onEnable in class JavaPlugin
    • onDisable

      public void onDisable()
      Specified by:
      onDisable in interface Plugin
      Overrides:
      onDisable in class JavaPlugin
    • loadOrGetScalaVersion

      public xyz.janboerman.scalaloader.ScalaLibraryClassLoader loadOrGetScalaVersion(xyz.janboerman.scalaloader.plugin.PluginScalaVersion scalaVersion) throws xyz.janboerman.scalaloader.plugin.ScalaPluginLoaderException
      Get a (fresh or cached) ScalaLibraryClassLoader that loads standard library classes from a specific Scala version. The classloader can either load classes from over the network directly, or use downloaded library archives (jar files).
      Parameters:
      scalaVersion - the scala version
      Returns:
      the class loader
      Throws:
      xyz.janboerman.scalaloader.plugin.ScalaPluginLoaderException - if a url is malformed.