re-adding support for !*
This commit is contained in:
parent
8c0b3ae954
commit
03186b6056
|
@ -27,7 +27,7 @@ public class Alias
|
|||
|
||||
public boolean hasCommandFor(int length)
|
||||
{
|
||||
return this.parameters.containsKey(length);
|
||||
return this.parameters.containsKey(length) || this.parameters.containsKey(-1);
|
||||
}
|
||||
|
||||
public String getPermissionNode()
|
||||
|
@ -42,7 +42,14 @@ public class Alias
|
|||
|
||||
Iterable<AliasCommand> getCommands(int length)
|
||||
{
|
||||
return this.parameters.get(length);
|
||||
List<AliasCommand> commands = this.parameters.get(length);
|
||||
|
||||
if(commands != null)
|
||||
{
|
||||
return commands;
|
||||
}
|
||||
|
||||
return this.parameters.get(-1);
|
||||
}
|
||||
|
||||
void setCommandsFor(int length,List<AliasCommand> commandsList)
|
||||
|
|
|
@ -72,7 +72,16 @@ public class AliasManager
|
|||
|
||||
if(!sArg.equalsIgnoreCase("permission"))
|
||||
{
|
||||
int iArg = Integer.parseInt(sArg);
|
||||
int iArg;
|
||||
|
||||
if(sArg.equals("*"))
|
||||
{
|
||||
iArg = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
iArg = Integer.parseInt(sArg);
|
||||
}
|
||||
|
||||
List<String> sArgLines = new ArrayList<String>();
|
||||
|
||||
|
@ -220,6 +229,10 @@ public class AliasManager
|
|||
return true;
|
||||
}
|
||||
}
|
||||
else if(text.equalsIgnoreCase("*"))
|
||||
{
|
||||
text = commandString;
|
||||
}
|
||||
else if(text.length() >= 2 && text.substring(1,2).equalsIgnoreCase("p"))
|
||||
{
|
||||
int iParam = -1;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: BetterAlias
|
||||
main: com.ne0nx3r0.betteralias.BetterAlias
|
||||
version: '1.0.1'
|
||||
version: '1.1.0'
|
||||
database: false
|
||||
description: Command alias system
|
||||
commands:
|
||||
|
|
Loading…
Reference in New Issue