fix wildcard and clean up command executor

This commit is contained in:
Super_
2020-07-01 12:45:09 -04:00
parent 9d7e0cdefc
commit 5421de0c2f
3 changed files with 35 additions and 12 deletions

View File

@ -1,6 +1,7 @@
package me.totalfreedom.totalfreedommod.command;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.Getter;
import me.totalfreedom.totalfreedommod.FreedomService;
@ -41,6 +42,16 @@ public class CommandLoader extends FreedomService
return null;
}
public boolean isAlias(String alias)
{
for (FreedomCommand command : commands)
{
if (Arrays.asList(command.getAliases().split(",")).contains(alias))
return true;
}
return false;
}
public int getCommandAmount()
{
return commands.size();