Bukkit  1.6.4-R2.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.plugin.java.JavaPlugin Class Reference

Represents a Java plugin. More...

+ Inheritance diagram for org.bukkit.plugin.java.JavaPlugin:
+ Collaboration diagram for org.bukkit.plugin.java.JavaPlugin:

Public Member Functions

 JavaPlugin ()
 
final File getDataFolder ()
 Returns the folder that the plugin data's files are located in.
 
final PluginLoader getPluginLoader ()
 Gets the associated PluginLoader responsible for this plugin.
 
final Server getServer ()
 Returns the Server instance currently running this plugin.
 
final boolean isEnabled ()
 Returns a value indicating whether or not this plugin is currently enabled.
 
final PluginDescriptionFile getDescription ()
 Returns the plugin.yaml file containing the details for this plugin.
 
FileConfiguration getConfig ()
 
void reloadConfig ()
 
void saveConfig ()
 
void saveDefaultConfig ()
 
void saveResource (String resourcePath, boolean replace)
 
InputStream getResource (String filename)
 
List< Class<?> > getDatabaseClasses ()
 Provides a list of all classes that should be persisted in the database.
 
final boolean isInitialized ()
 Gets the initialization status of this plugin.
 
boolean onCommand (CommandSender sender, Command command, String label, String[] args)
 
 
List< String > onTabComplete (CommandSender sender, Command command, String alias, String[] args)
 
 
PluginCommand getCommand (String name)
 Gets the command with the given name, specific to this plugin.
 
void onLoad ()
 
void onDisable ()
 
void onEnable ()
 
ChunkGenerator getDefaultWorldGenerator (String worldName, String id)
 
final boolean isNaggable ()
 
final void setNaggable (boolean canNag)
 
EbeanServer getDatabase ()
 
final Logger getLogger ()
 
String toString ()
 
- Public Member Functions inherited from org.bukkit.plugin.PluginBase
final int hashCode ()
 
final boolean equals (Object obj)
 
final String getName ()
 
- Public Member Functions inherited from org.bukkit.plugin.Plugin
File getDataFolder ()
 Returns the folder that the plugin data's files are located in.
 
PluginDescriptionFile getDescription ()
 Returns the plugin.yaml file containing the details for this plugin.
 
FileConfiguration getConfig ()
 Gets a FileConfiguration for this plugin, read through "config.yml".
 
InputStream getResource (String filename)
 Gets an embedded resource in this plugin.
 
void saveConfig ()
 Saves the FileConfiguration retrievable by getConfig().
 
void saveDefaultConfig ()
 Saves the raw contents of the default config.yml file to the location retrievable by getConfig().
 
void 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).
 
void reloadConfig ()
 Discards any data in getConfig() and reloads from disk.
 
PluginLoader getPluginLoader ()
 Gets the associated PluginLoader responsible for this plugin.
 
Server getServer ()
 Returns the Server instance currently running this plugin.
 
boolean isEnabled ()
 Returns a value indicating whether or not this plugin is currently enabled.
 
void onDisable ()
 Called when this plugin is disabled.
 
void onLoad ()
 Called after a plugin is loaded but before it has been enabled.
 
void onEnable ()
 Called when this plugin is enabled.
 
boolean isNaggable ()
 Simple boolean if we can still nag to the logs about things.
 
void setNaggable (boolean canNag)
 Set naggable state.
 
EbeanServer getDatabase ()
 Gets the EbeanServer tied to this plugin.
 
ChunkGenerator getDefaultWorldGenerator (String worldName, String id)
 Gets a ChunkGenerator for use in a default world, as specified in the server configuration.
 
Logger getLogger ()
 Returns the primary logger associated with this server instance.
 
String getName ()
 Returns the name of the plugin.
 

Protected Member Functions

File getFile ()
 Returns the file which contains this plugin.
 
final ClassLoader getClassLoader ()
 Returns the ClassLoader which holds this plugin.
 
final void setEnabled (final boolean enabled)
 Sets the enabled state of this plugin.
 
final void initialize (PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader)
 Initializes this plugin with the given variables.
 
void installDDL ()
 
void removeDDL ()
 

Detailed Description

Represents a Java plugin.

Definition at line 37 of file JavaPlugin.java.

Constructor & Destructor Documentation

org.bukkit.plugin.java.JavaPlugin.JavaPlugin ( )

Definition at line 52 of file JavaPlugin.java.

Member Function Documentation

final ClassLoader org.bukkit.plugin.java.JavaPlugin.getClassLoader ( )
protected

Returns the ClassLoader which holds this plugin.

Returns
ClassLoader holding this plugin

Definition at line 203 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(), org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(), and org.bukkit.plugin.java.JavaPlugin.getResource().

PluginCommand org.bukkit.plugin.java.JavaPlugin.getCommand ( String  name)

Gets the command with the given name, specific to this plugin.

Commands need to be registered in the PluginDescriptionFile to exist at runtime.

Parameters
namename or alias of the command
Returns
the plugin command if found, otherwise null

Definition at line 317 of file JavaPlugin.java.

References org.bukkit.plugin.PluginDescriptionFile.getName(), org.bukkit.command.PluginCommand.getPlugin(), org.bukkit.Server.getPluginCommand(), and org.bukkit.plugin.java.JavaPlugin.getServer().

FileConfiguration org.bukkit.plugin.java.JavaPlugin.getConfig ( )
EbeanServer org.bukkit.plugin.java.JavaPlugin.getDatabase ( )
List<Class<?> > org.bukkit.plugin.java.JavaPlugin.getDatabaseClasses ( )

Provides a list of all classes that should be persisted in the database.

Returns
List of Classes that are Ebeans

Definition at line 276 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPlugin.initialize().

final File org.bukkit.plugin.java.JavaPlugin.getDataFolder ( )

Returns the folder that the plugin data's files are located in.

The folder may not yet exist.

Returns
The folder.

Definition at line 60 of file JavaPlugin.java.

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

Definition at line 338 of file JavaPlugin.java.

final PluginDescriptionFile org.bukkit.plugin.java.JavaPlugin.getDescription ( )

Returns the plugin.yaml file containing the details for this plugin.

Returns
Contents of the plugin.yaml file

Definition at line 105 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(), and org.bukkit.plugin.java.JavaPluginLoader.enablePlugin().

File org.bukkit.plugin.java.JavaPlugin.getFile ( )
protected

Returns the file which contains this plugin.

Returns
File containing this plugin

Definition at line 96 of file JavaPlugin.java.

final Logger org.bukkit.plugin.java.JavaPlugin.getLogger ( )

Definition at line 368 of file JavaPlugin.java.

final PluginLoader org.bukkit.plugin.java.JavaPlugin.getPluginLoader ( )

Gets the associated PluginLoader responsible for this plugin.

Returns
PluginLoader that controls this plugin

Definition at line 69 of file JavaPlugin.java.

InputStream org.bukkit.plugin.java.JavaPlugin.getResource ( String  filename)
final Server org.bukkit.plugin.java.JavaPlugin.getServer ( )

Returns the Server instance currently running this plugin.

Returns
Server running this plugin

Definition at line 78 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPlugin.getCommand().

final void org.bukkit.plugin.java.JavaPlugin.initialize ( PluginLoader  loader,
Server  server,
PluginDescriptionFile  description,
File  dataFolder,
File  file,
ClassLoader  classLoader 
)
protected

Initializes this plugin with the given variables.

This method should never be called manually.

Parameters
loaderPluginLoader that is responsible for this plugin
serverServer instance that is running this plugin
descriptionPluginDescriptionFile containing metadata on this plugin
dataFolderFolder containing the plugin's data
fileFile containing this plugin
classLoaderClassLoader which holds this plugin

Definition at line 236 of file JavaPlugin.java.

References org.bukkit.Server.configureDbConfig(), org.bukkit.plugin.java.JavaPlugin.getDatabaseClasses(), org.bukkit.plugin.PluginDescriptionFile.getName(), and org.bukkit.plugin.PluginDescriptionFile.isDatabaseEnabled().

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

void org.bukkit.plugin.java.JavaPlugin.installDDL ( )
protected

Definition at line 354 of file JavaPlugin.java.

References org.bukkit.plugin.java.JavaPlugin.getDatabase().

final boolean org.bukkit.plugin.java.JavaPlugin.isEnabled ( )

Returns a value indicating whether or not this plugin is currently enabled.

Returns
true if this plugin is enabled, otherwise false

Definition at line 87 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPlugin.setEnabled().

final boolean org.bukkit.plugin.java.JavaPlugin.isInitialized ( )

Gets the initialization status of this plugin.

Returns
true if this plugin is initialized, otherwise false

Definition at line 291 of file JavaPlugin.java.

final boolean org.bukkit.plugin.java.JavaPlugin.isNaggable ( )

Definition at line 342 of file JavaPlugin.java.

boolean org.bukkit.plugin.java.JavaPlugin.onCommand ( CommandSender  sender,
Command  command,
String  label,
String[]  args 
)

Definition at line 298 of file JavaPlugin.java.

void org.bukkit.plugin.java.JavaPlugin.onDisable ( )

Definition at line 334 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPlugin.setEnabled().

void org.bukkit.plugin.java.JavaPlugin.onEnable ( )

Definition at line 336 of file JavaPlugin.java.

Referenced by org.bukkit.plugin.java.JavaPlugin.setEnabled().

void org.bukkit.plugin.java.JavaPlugin.onLoad ( )

Definition at line 332 of file JavaPlugin.java.

List<String> org.bukkit.plugin.java.JavaPlugin.onTabComplete ( CommandSender  sender,
Command  command,
String  alias,
String[]  args 
)

Definition at line 305 of file JavaPlugin.java.

void org.bukkit.plugin.java.JavaPlugin.removeDDL ( )
protected

Definition at line 361 of file JavaPlugin.java.

References org.bukkit.plugin.java.JavaPlugin.getDatabase().

void org.bukkit.plugin.java.JavaPlugin.saveConfig ( )
void org.bukkit.plugin.java.JavaPlugin.saveDefaultConfig ( )

Definition at line 135 of file JavaPlugin.java.

References org.bukkit.plugin.java.JavaPlugin.saveResource().

void org.bukkit.plugin.java.JavaPlugin.saveResource ( String  resourcePath,
boolean  replace 
)
final void org.bukkit.plugin.java.JavaPlugin.setEnabled ( final boolean  enabled)
protected
final void org.bukkit.plugin.java.JavaPlugin.setNaggable ( boolean  canNag)

Definition at line 346 of file JavaPlugin.java.

String org.bukkit.plugin.java.JavaPlugin.toString ( )

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