Code cleanup
This commit is contained in:
parent
cc574c3450
commit
ffa7c3f850
3 changed files with 2 additions and 6 deletions
|
@ -79,9 +79,6 @@ public class CommandCaller implements CommandExecutor {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command,
|
public boolean onCommand(CommandSender sender, Command command,
|
||||||
String alias, String[] args) {
|
String alias, String[] args) {
|
||||||
// TODO: Test if path exists, if not,
|
|
||||||
// go up one level, and
|
|
||||||
// finally fallback to args.length==0
|
|
||||||
String path = command.getName();
|
String path = command.getName();
|
||||||
for (String arg : args)
|
for (String arg : args)
|
||||||
path += "/" + arg;
|
path += "/" + arg;
|
||||||
|
@ -91,7 +88,6 @@ public class CommandCaller implements CommandExecutor {
|
||||||
path = path.substring(0, path.lastIndexOf('/'));
|
path = path.substring(0, path.lastIndexOf('/'));
|
||||||
argc++;
|
argc++;
|
||||||
cmd = commands.get(path);
|
cmd = commands.get(path);
|
||||||
System.out.println(path);
|
|
||||||
}
|
}
|
||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
sender.sendMessage("§cInternal error: Command not registered to CommandCaller");
|
sender.sendMessage("§cInternal error: Command not registered to CommandCaller");
|
||||||
|
|
|
@ -4,7 +4,7 @@ import io.github.norbipeti.thebuttonmcchat.commands.ucmds.UCommandBase;
|
||||||
|
|
||||||
public abstract class AdminCommandBase extends UCommandBase {
|
public abstract class AdminCommandBase extends UCommandBase {
|
||||||
|
|
||||||
public abstract String[] GetHelpText(String alias); //TODO: Require permissionű
|
public abstract String[] GetHelpText(String alias); //TODO: Require permission
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String GetUCommandPath() {
|
public String GetUCommandPath() {
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class UpdatePlugin extends AdminCommandBase {
|
||||||
URL url;
|
URL url;
|
||||||
try {
|
try {
|
||||||
url = new URL(
|
url = new URL(
|
||||||
"https://github.com/NorbiPeti/thebuttonmcchat/raw/master/TheButtonMCChat.jar"); //TODO: Save with this name
|
"https://github.com/NorbiPeti/thebuttonmcchat/raw/master/TheButtonMCChat.jar");
|
||||||
FileUtils.copyURLToFile(url, new File(
|
FileUtils.copyURLToFile(url, new File(
|
||||||
"plugins/TheButtonMCChat.jar"));
|
"plugins/TheButtonMCChat.jar"));
|
||||||
sender.sendMessage("Updating done!");
|
sender.sendMessage("Updating done!");
|
||||||
|
|
Loading…
Reference in a new issue