Added more flexibility to the Bukkit dynamic command registration system.

This commit is contained in:
zml2008
2011-12-29 13:59:48 -08:00
parent 76f1ea9cf2
commit 4fb44ebc1d
4 changed files with 36 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ package com.sk89q.bukkit.util;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandsManager;
import org.bukkit.command.CommandExecutor;
import org.bukkit.plugin.Plugin;
import java.util.List;
@@ -35,6 +36,11 @@ public class CommandsManagerRegistration extends CommandRegistration {
this.commands = commands;
}
public CommandsManagerRegistration(Plugin plugin, CommandExecutor executor, CommandsManager<?> commands) {
super(plugin, executor);
this.commands = commands;
}
public boolean register(Class<?> clazz) {
List<Command> registered = commands.registerAndReturn(clazz);
return registerAll(registered);