diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index d7152a96..772c0490 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -34,12 +34,23 @@ public class PluginManager private final Map plugins = new HashMap<>(); private final Map commandMap = new HashMap<>(); + /** + * @deprecated use + * {@link #registerCommand(net.md_5.bungee.api.plugin.Plugin, net.md_5.bungee.api.plugin.Command)} + */ + @Deprecated + public void registerCommand(Command command) + { + registerCommand( null, command ); + } + /** * Register a command so that it may be executed. * + * @param plugin the plugin owning this command * @param command the command to register */ - public void registerCommand(Command command) + public void registerCommand(Plugin plugin, Command command) { commandMap.put( command.getName().toLowerCase(), command ); for ( String alias : command.getAliases() ) @@ -215,14 +226,25 @@ public class PluginManager return event; } + /** + * @deprecated see + * {@link #registerListener(net.md_5.bungee.api.plugin.Plugin, net.md_5.bungee.api.plugin.Listener)} + */ + @Deprecated + public void registerListener(Listener listener) + { + registerListener( null, listener ); + } + /** * Register a {@link Listener} for receiving called events. Methods in this * Object which wish to receive events must be annotated with the * {@link Subscribe} annotation. * + * @param plugin the owning plugin * @param listener the listener to register events for */ - public void registerListener(Listener listener) + public void registerListener(Plugin plugin, Listener listener) { eventBus.register( listener ); }