Few additions to Plugin for retrieving the Server and PluginLoader responsible for the plugin

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2010-12-24 13:06:44 +00:00
parent 118fbe5d87
commit e3d491491a
2 changed files with 35 additions and 1 deletions

View File

@@ -1,11 +1,44 @@
package org.bukkit.plugin;
import org.bukkit.Server;
/**
* Represents a plugin
*/
public abstract class Plugin {
private boolean isEnabled = false;
private final PluginLoader loader;
private final Server server;
/**
* Constructs a new plugin instance
*
* @param pluginLoader PluginLoader that is responsible for this plugin
* @param instance Server instance that is running this plugin
*/
protected Plugin(PluginLoader pluginLoader, Server instance) {
loader = pluginLoader;
server = instance;
}
/**
* Gets the associated PluginLoader responsible for this plugin
*
* @return PluginLoader that controls this plugin
*/
protected final PluginLoader getPluginLoader() {
return loader;
}
/**
* Returns the Server instance currently running this plugin
*
* @return Server running this plugin
*/
public final Server getServer() {
return server;
}
/**
* Returns a value indicating whether or not this plugin is currently enabled