Added more flexibility to the Bukkit dynamic command registration system.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user