Class SpigotCore
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
,org.bukkit.command.TabExecutor
,org.bukkit.plugin.Plugin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SpigotCore
The `instance` variable represents an instance of the `SpigotCore` class, which is a core plugin class for Spigot. -
Constructor Summary
Constructors -
Method Summary
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, toString
Methods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
-
Field Details
-
instance
The `instance` variable represents an instance of the `SpigotCore` class, which is a core plugin class for Spigot.This variable is declared as `protected`, which means it can be accessed by subclasses within the same package and by subclasses in different packages.
The purpose of this variable is to hold a reference to the running plugin instance. It is assigned with the value of `this` in the `onEnable()` method.
This variable can be accessed by other methods within the `SpigotCore` class or its subclasses to access the running plugin object.
Example usage:
SpigotCore plugin = instance;
- See Also:
-
-
Constructor Details
-
SpigotCore
public SpigotCore()
-
-
Method Details
-
onEnable
public void onEnable()Called when the plugin is enabled.- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()This method is called when the plugin is being disabled.During the onDisable() method, any clean up or finalization tasks can be performed. This method is usually used to save data, close connections, or perform any necessary cleanup operations before the plugin is completely shut down.
Note that when the plugin is disabled, it will no longer receive events or be able to execute commands.
- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
onLoad
public void onLoad()This method is called when the plugin is being loaded by the server. It is responsible for any necessary preloading tasks or initializations.This method is automatically called by the Spigot server and should not be called manually.
Note: This method does not have a specific implementation in the given code sample. Developers should extend this class and override the `onLoad` method to provide any specific functionality required during plugin loading.
- Specified by:
onLoad
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onLoad
in classorg.bukkit.plugin.java.JavaPlugin
- See Also:
-
SpigotCore
JavaPlugin.onLoad()
-