Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.plugin.Plugin Interface Reference
Inheritance diagram for org.bukkit.plugin.Plugin:
org.bukkit.command.TabExecutor org.bukkit.command.TabCompleter org.bukkit.command.CommandExecutor org.bukkit.plugin.PluginBase org.bukkit.plugin.java.JavaPlugin org.bukkit.plugin.TestPlugin

Public Member Functions

File getDataFolder ()
 
PluginDescriptionFile getDescription ()
 
FileConfiguration getConfig ()
 
InputStream getResource (String filename)
 
void saveConfig ()
 
void saveDefaultConfig ()
 
void saveResource (String resourcePath, boolean replace)
 
void reloadConfig ()
 
PluginLoader getPluginLoader ()
 
Server getServer ()
 
boolean isEnabled ()
 
void onDisable ()
 
void onLoad ()
 
void onEnable ()
 
boolean isNaggable ()
 
void setNaggable (boolean canNag)
 
EbeanServer getDatabase ()
 
ChunkGenerator getDefaultWorldGenerator (String worldName, String id)
 
Logger getLogger ()
 
String getName ()
 
- Public Member Functions inherited from org.bukkit.command.TabCompleter
List< String > onTabComplete (CommandSender sender, Command command, String alias, String[] args)
 
- Public Member Functions inherited from org.bukkit.command.CommandExecutor
boolean onCommand (CommandSender sender, Command command, String label, String[] args)
 

Detailed Description

Represents a Plugin

The use of PluginBase is recommended for actual Implementation

Definition at line 19 of file Plugin.java.

Member Function Documentation

FileConfiguration org.bukkit.plugin.Plugin.getConfig ( )

Gets a FileConfiguration for this plugin, read through "config.yml"

If there is a default config.yml embedded in this plugin, it will be provided as a default for this Configuration.

Returns
Plugin configuration

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

EbeanServer org.bukkit.plugin.Plugin.getDatabase ( )

Gets the EbeanServer tied to this plugin. This will only be available if enabled in the PluginDescriptionFile#isDatabaseEnabled()

For more information on the use of Avaje Ebeans ORM, see Avaje Ebeans Documentation

For an example using Ebeans ORM, see Bukkit's Homebukkit Plugin

Returns
ebean server instance or null if not enabled

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

File org.bukkit.plugin.Plugin.getDataFolder ( )

Returns the folder that the plugin data's files are located in. The folder may not yet exist.

Returns
The folder

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

ChunkGenerator org.bukkit.plugin.Plugin.getDefaultWorldGenerator ( String  worldName,
String  id 
)

Gets a ChunkGenerator for use in a default world, as specified in the server configuration

Parameters
worldNameName of the world that this will be applied to
idUnique ID, if any, that was specified to indicate which generator was requested
Returns
ChunkGenerator for use in the default world generation

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

Referenced by org.bukkit.WorldCreator.getGeneratorForName().

Logger org.bukkit.plugin.Plugin.getLogger ( )

Returns the plugin logger associated with this server's logger. The returned logger automatically tags all log messages with the plugin's name.

Returns
Logger associated with this plugin

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

Referenced by org.bukkit.plugin.java.JavaPluginLoader.disablePlugin().

String org.bukkit.plugin.Plugin.getName ( )

Returns the name of the plugin.

This should return the bare name of the plugin and should be used for comparison.

Returns
name of the plugin

Implemented in org.bukkit.plugin.PluginBase.

Referenced by org.bukkit.plugin.SimplePluginManager.loadPlugin().

PluginLoader org.bukkit.plugin.Plugin.getPluginLoader ( )

Gets the associated PluginLoader responsible for this plugin

Returns
PluginLoader that controls this plugin

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

Referenced by org.bukkit.plugin.SimplePluginManager.registerEvents().

InputStream org.bukkit.plugin.Plugin.getResource ( String  filename)

Gets an embedded resource in this plugin

Parameters
filenameFilename of the resource
Returns
File if found, otherwise null

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

Server org.bukkit.plugin.Plugin.getServer ( )

Returns the Server instance currently running this plugin

Returns
Server running this plugin

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

Referenced by org.bukkit.plugin.PluginLogger.PluginLogger().

boolean org.bukkit.plugin.Plugin.isNaggable ( )

Simple boolean if we can still nag to the logs about things

Returns
boolean whether we can nag

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.onDisable ( )

Called when this plugin is disabled

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.onEnable ( )

Called when this plugin is enabled

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.onLoad ( )

Called after a plugin is loaded but before it has been enabled.

When mulitple plugins are loaded, the onLoad() for all plugins is called before any onEnable() is called.

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.reloadConfig ( )

Discards any data in getConfig() and reloads from disk.

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.saveConfig ( )
void org.bukkit.plugin.Plugin.saveDefaultConfig ( )

Saves the raw contents of the default config.yml file to the location retrievable by getConfig(). If there is no default config.yml embedded in the plugin, an empty config.yml file is saved. This should fail silently if the config.yml already exists.

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.saveResource ( String  resourcePath,
boolean  replace 
)

Saves the raw contents of any resource embedded with a plugin's .jar file assuming it can be found using getResource(String).

The resource is saved into the plugin's data folder using the same hierarchy as the .jar file (subdirectories are preserved).

Parameters
resourcePaththe embedded resource path to look for within the plugin's .jar file. (No preceding slash).
replaceif true, the embedded resource will overwrite the contents of an existing file.
Exceptions
IllegalArgumentExceptionif the resource path is null, empty, or points to a nonexistent resource.

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.

void org.bukkit.plugin.Plugin.setNaggable ( boolean  canNag)

Set naggable state

Parameters
canNagis this plugin still naggable?

Implemented in org.bukkit.plugin.java.JavaPlugin, and org.bukkit.plugin.TestPlugin.


The documentation for this interface was generated from the following file: