Package xyz.janboerman.scalaloader
Class ScalaLoader
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
xyz.janboerman.scalaloader.ScalaLoader
- All Implemented Interfaces:
CommandExecutor,TabCompleter,TabExecutor,Plugin,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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInternal use onlyGet the EventBus used for registering and callingEvents.Pattern[]Get the loaded ScalaPlugins.Get the folder from which ScalaPlugins are loaded.booleanGet whether ScalaLoader is a Paper PluginloadOrGetScalaVersion(PluginScalaVersion scalaVersion) Get a (fresh or cached)ScalaLibraryClassLoaderthat loads standard library classes from a specific Scala version.voidvoidonEnable()voidonLoad()Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.command.CommandExecutor
onCommandMethods inherited from interface xyz.janboerman.scalaloader.compat.IScalaLoader
runInMainThread, saveScalaVersionsToConfigMethods inherited from interface org.bukkit.plugin.Plugin
getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getLogger, getName, getPluginLoader, getResource, getServer, isEnabled, isNaggable, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setNaggableMethods inherited from interface org.bukkit.command.TabCompleter
onTabComplete
-
Constructor Details
-
ScalaLoader
public ScalaLoader()
-
-
Method Details
-
isPaperPlugin
public boolean isPaperPlugin()Description copied from interface:IScalaLoaderGet whether ScalaLoader is a Paper Plugin- Specified by:
isPaperPluginin interfaceIScalaLoader- Returns:
- true if ScalaLoader is a Paper Plugin, false if it is a regular Bukkit plugin.
- See Also:
-
getDebugSettings
Description copied from interface:IScalaLoaderInternal use only- Specified by:
getDebugSettingsin interfaceIScalaLoader
-
getScalaPluginsFolder
Description copied from interface:IScalaLoaderGet the folder from which ScalaPlugins are loaded. By default this is server_root/plugins/ScalaLoader/scalaplugins- Specified by:
getScalaPluginsFolderin interfaceIScalaLoader- Returns:
- the folder from which ScalaPlugins are loaded
-
getScalaPlugins
Description copied from interface:IScalaLoaderGet the loaded ScalaPlugins.- Specified by:
getScalaPluginsin interfaceIScalaLoader- Returns:
- the loaded ScalaPlugins.
-
getEventBus
Description copied from interface:IScalaLoaderGet the EventBus used for registering and callingEvents.- Specified by:
getEventBusin interfaceIScalaLoader- Returns:
- the event bus
-
getJavaPluginLoaderPatterns
-
onLoad
public void onLoad()- Specified by:
onLoadin interfacePlugin- Overrides:
onLoadin classJavaPlugin
-
onEnable
public void onEnable()- Specified by:
onEnablein interfacePlugin- Overrides:
onEnablein classJavaPlugin
-
onDisable
public void onDisable()- Specified by:
onDisablein interfacePlugin- Overrides:
onDisablein classJavaPlugin
-
loadOrGetScalaVersion
public ScalaLibraryClassLoader loadOrGetScalaVersion(PluginScalaVersion scalaVersion) throws ScalaPluginLoaderException Get a (fresh or cached)ScalaLibraryClassLoaderthat 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:
ScalaPluginLoaderException- if a url is malformed.
-