Tweaks to command system to allow setting executors via plugins (no more ambiguous onCommand in plugins)
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
@@ -3,14 +3,13 @@ package org.bukkit.plugin;
|
||||
|
||||
import java.io.File;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.util.config.Configuration;
|
||||
|
||||
/**
|
||||
* Represents a Plugin
|
||||
*/
|
||||
public interface Plugin {
|
||||
public interface Plugin extends CommandExecutor {
|
||||
/**
|
||||
* Returns the folder that the plugin data's files are located in. The
|
||||
* folder may not yet exist.
|
||||
@@ -63,11 +62,4 @@ public interface Plugin {
|
||||
* Called when this plugin is enabled
|
||||
*/
|
||||
public void onEnable();
|
||||
|
||||
/**
|
||||
* Called when a command registered by this plugin is received.
|
||||
* @param commandLabel
|
||||
* @return TODO
|
||||
*/
|
||||
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
package org.bukkit.plugin.java;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginLoader;
|
||||
@@ -121,13 +119,6 @@ public abstract class JavaPlugin implements Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a command registered by this plugin is received.
|
||||
*/
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
|
||||
return false; // default implementation: do nothing!
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes this plugin with the given variables.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user