Package ch.njol.skript
Class SkriptAddon
java.lang.Object
ch.njol.skript.SkriptAddon
- All Implemented Interfaces:
SkriptAddon,ViewProvider<SkriptAddon>
@Deprecated(since="2.14",
forRemoval=true)
public final class SkriptAddon
extends Object
implements SkriptAddon
Deprecated, for removal: This API element is subject to removal in a future version.
Utility class for Skript addons. Use
Skript.registerAddon(JavaPlugin) to create a SkriptAddon instance for your plugin.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@Nullable FilegetFile()Deprecated, for removal: This API element is subject to removal in a future version.The first invocation of this method uses reflection to invoke the protected methodJavaPlugin.getFile()to get the plugin's jar file.@Nullable StringDeprecated, for removal: This API element is subject to removal in a future version.getName()Deprecated, for removal: This API element is subject to removal in a future version.booleanhasRegistry(Class<? extends Registry<?>> registryClass) Deprecated, for removal: This API element is subject to removal in a future version.Determines whether a registry has been stored underregistryClass.loadClasses(String basePackage, String... subPackages) Deprecated, for removal: This API element is subject to removal in a future version.Loads classes of the plugin by package.Deprecated, for removal: This API element is subject to removal in a future version.name()Deprecated, for removal: This API element is subject to removal in a future version.<R extends Registry<?>>
RDeprecated, for removal: This API element is subject to removal in a future version.Obtains the registry stored underregistryClass.<R extends Registry<?>>
RDeprecated, for removal: This API element is subject to removal in a future version.Searches for a registry stored underregistryClass.voidremoveRegistry(Class<? extends Registry<?>> registryClass) Deprecated, for removal: This API element is subject to removal in a future version.Removes the registry stored underregistryClass.setLanguageFileDirectory(String directory) Deprecated, for removal: This API element is subject to removal in a future version.Makes Skript load language files from the specified directory, e.g.Class<?> source()Deprecated, for removal: This API element is subject to removal in a future version.<R extends Registry<?>>
voidstoreRegistry(Class<R> registryClass, R registry) Deprecated, for removal: This API element is subject to removal in a future version.Stores a registry underregistryClass.Deprecated, for removal: This API element is subject to removal in a future version.final StringtoString()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.skriptlang.skript.addon.SkriptAddon
loadModules, unmodifiableView
-
Field Details
-
plugin
public final org.bukkit.plugin.java.JavaPlugin pluginDeprecated, for removal: This API element is subject to removal in a future version. -
version
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
toString
Deprecated, for removal: This API element is subject to removal in a future version. -
getName
Deprecated, for removal: This API element is subject to removal in a future version. -
loadClasses
Deprecated, for removal: This API element is subject to removal in a future version.Loads classes of the plugin by package. Useful for registering many syntax elements like Skript does it.- Parameters:
basePackage- The base package to add to all sub packages, e.g. "ch.njol.skript".subPackages- Which subpackages of the base package should be loaded, e.g. "expressions", "conditions", "effects". Subpackages of these packages will be loaded as well. Use an empty array to load all subpackages of the base package.- Returns:
- This SkriptAddon
- Throws:
IOException- If some error occurred attempting to read the plugin's jar file.
-
setLanguageFileDirectory
Deprecated, for removal: This API element is subject to removal in a future version.Makes Skript load language files from the specified directory, e.g. "lang" or "skript lang" if you have a lang folder yourself. Localised files will be read from the plugin's jar and the plugin's data folder, but the default English file is only taken from the jar and must exist!- Parameters:
directory- Directory name- Returns:
- This SkriptAddon
-
getLanguageFileDirectory
Deprecated, for removal: This API element is subject to removal in a future version. -
getFile
Deprecated, for removal: This API element is subject to removal in a future version.The first invocation of this method uses reflection to invoke the protected methodJavaPlugin.getFile()to get the plugin's jar file. The file is then cached and returned upon subsequent calls to this method to reduce usage of reflection. Only nullable if there was an exception thrown.- Returns:
- The jar file of the plugin.
-
source
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
sourcein interfaceSkriptAddon- Returns:
- A class from the application that registered this addon. Typically, this is the main class or the specific class in which registration occurred.
-
name
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
namein interfaceSkriptAddon- Returns:
- The name of this addon.
-
storeRegistry
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SkriptAddonStores a registry underregistryClass. If a registry is already stored underregistryClass, it will be replaced.- Specified by:
storeRegistryin interfaceSkriptAddon- Type Parameters:
R- The type of registry.- Parameters:
registryClass- The class (key) to storeregistryunder.registry- The registry to store.
-
removeRegistry
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SkriptAddonRemoves the registry stored underregistryClass. It is safe to call this method even if a registry is not stored underregistryClass.- Specified by:
removeRegistryin interfaceSkriptAddon- Parameters:
registryClass- The class (key) that the registry to remove is under.
-
hasRegistry
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SkriptAddonDetermines whether a registry has been stored underregistryClass.- Specified by:
hasRegistryin interfaceSkriptAddon- Parameters:
registryClass- The class (key) to search for a registry under.- Returns:
- Whether a registry is stored under
registryClass.
-
registry
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SkriptAddonObtains the registry stored underregistryClass. This method will never return null, meaning it may be necessary to callSkriptAddon.hasRegistry(Class)if you are not sure whether the registry you need exists.- Specified by:
registryin interfaceSkriptAddon- Type Parameters:
R- The type of registry.- Parameters:
registryClass- The class (key) that the registry is stored under.- Returns:
- The registry stored under
registryClass.
-
registry
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SkriptAddonSearches for a registry stored underregistryClass. If the search fails,putIfAbsentwill be used to get, store, and return a registry of the requested type.- Specified by:
registryin interfaceSkriptAddon- Type Parameters:
R- The type of registry.- Parameters:
registryClass- The class (key) to search for a registry under.putIfAbsent- A supplier to use for creating an instance of the desired type of registry if one is not already stored underregistryClass.- Returns:
- The registry stored under
registryClassor created fromputIfAbsent.
-
syntaxRegistry
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
syntaxRegistryin interfaceSkriptAddon- Returns:
- A syntax registry for this addon's syntax.
-
localizer
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
localizerin interfaceSkriptAddon- Returns:
- A localizer for this addon's localizations.
-
SkriptAddoninstead. Register usingSkript.registerAddon(Class, String). Obtain a Skript instance withSkript.instance().