mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 06:28:52 +00:00
Renamed package and groupId
This commit is contained in:
1 parent
21d0108c16
commit
7f13a0ad4c
78 files changed
+396
-370
No files matched your search
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* AntiCheat for Bukkit.
|
||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.rammelkast.anticheatreloaded.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandCheck;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandDebug;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandDeveloper;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandHelp;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandLog;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandReload;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandReport;
|
||||
import com.rammelkast.anticheatreloaded.command.executors.CommandReset;
|
||||
|
||||
public class CommandHandler implements CommandExecutor {
|
||||
|
||||
private List<CommandBase> commands = new ArrayList<CommandBase>();
|
||||
|
||||
public CommandHandler() {
|
||||
commands.add(new CommandHelp());
|
||||
commands.add(new CommandCheck());
|
||||
commands.add(new CommandDebug());
|
||||
commands.add(new CommandDeveloper());
|
||||
commands.add(new CommandLog());
|
||||
commands.add(new CommandReload());
|
||||
commands.add(new CommandReport());
|
||||
commands.add(new CommandReset());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender cs, Command cmd, String alias, String[] args) {
|
||||
if (args.length >= 1) {
|
||||
String command = args[0];
|
||||
// Shift args down
|
||||
String[] newArgs = new String[args.length-1];
|
||||
for (int i=1;i<args.length;i++) {
|
||||
newArgs[i-1] = args[i];
|
||||
}
|
||||
for (CommandBase base : commands) {
|
||||
if (base.getCommand().equalsIgnoreCase(command)) {
|
||||
base.run(cs, newArgs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Command not found, send help
|
||||
commands.get(0).run(cs, null);
|
||||
} else {
|
||||
// Send help
|
||||
commands.get(0).run(cs, null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user