Search in sources :

Example 11 with IEssentialsCommand

use of com.earth2me.essentials.commands.IEssentialsCommand in project Essentials by EssentialsX.

the class EconomyTest method runCommand.

private void runCommand(String command, User user, String[] args) throws Exception {
    IEssentialsCommand cmd;
    try {
        cmd = (IEssentialsCommand) Essentials.class.getClassLoader().loadClass("com.earth2me.essentials.commands.Command" + command).newInstance();
        cmd.setEssentials(ess);
        cmd.run(server, user, command, null, args);
    } catch (NoChargeException ex) {
    }
}
Also used : NoChargeException(com.earth2me.essentials.commands.NoChargeException) IEssentialsCommand(com.earth2me.essentials.commands.IEssentialsCommand)

Example 12 with IEssentialsCommand

use of com.earth2me.essentials.commands.IEssentialsCommand in project Essentials by EssentialsX.

the class MessagingTest method runConsoleCommand.

private void runConsoleCommand(String command, String[] args) throws Exception {
    IEssentialsCommand cmd;
    CommandSender sender = server.getConsoleSender();
    try {
        cmd = (IEssentialsCommand) Essentials.class.getClassLoader().loadClass("com.earth2me.essentials.commands.Command" + command).newInstance();
        cmd.setEssentials(ess);
        cmd.run(server, new CommandSource(sender), command, null, args);
    } catch (NoChargeException ex) {
    }
}
Also used : NoChargeException(com.earth2me.essentials.commands.NoChargeException) IEssentialsCommand(com.earth2me.essentials.commands.IEssentialsCommand) CommandSender(org.bukkit.command.CommandSender)

Aggregations

IEssentialsCommand (com.earth2me.essentials.commands.IEssentialsCommand)12 NoChargeException (com.earth2me.essentials.commands.NoChargeException)12 CommandSender (org.bukkit.command.CommandSender)6