Skip to content

Commit

Permalink
Return loader instance from registerInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphan Kochen committed Feb 25, 2011
1 parent 702b596 commit 0661cc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/bukkit/plugin/PluginManager.java
Expand Up @@ -10,14 +10,13 @@
* Handles all plugin management from the Server
*/
public interface PluginManager {

/**
* Registers the specified plugin loader
*
* @param loader Class name of the PluginLoader to register
* @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader
*/
public void registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException;
public PluginLoader registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException;

/**
* Rediscover and reindex all plugins
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/bukkit/plugin/SimplePluginManager.java
Expand Up @@ -64,7 +64,7 @@ public SimplePluginManager(Server server, File pluginFolder) {
* @param loader Class name of the PluginLoader to register
* @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader
*/
public void registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException {
public PluginLoader registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException {
PluginLoader instance;

if (PluginLoader.class.isAssignableFrom(loader)) {
Expand All @@ -82,6 +82,8 @@ public void registerInterface(Class<? extends PluginLoader> loader) throws Illeg
}

pluginLoaders.add(instance);

return instance;
}

/**
Expand Down

0 comments on commit 0661cc5

Please sign in to comment.