mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-27 03:28:30 +01:00
Merge pull request #192 from evonuts/2.9
Allow for console based gamemode shortcuts. Fixes ticket #3173
This commit is contained in:
commit
0df0be5762
@ -19,14 +19,24 @@ public class Commandgamemode extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
GameMode gameMode;
|
||||
if (args.length == 0)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
GameMode gameMode = matchGameMode(args[0].toLowerCase(Locale.ENGLISH));
|
||||
else if (args.length == 1)
|
||||
{
|
||||
gameMode = matchGameMode(commandLabel);
|
||||
gamemodeOtherPlayers(server, sender, gameMode, args[0]);
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
gameMode = matchGameMode(args[0].toLowerCase(Locale.ENGLISH));
|
||||
gamemodeOtherPlayers(server, sender, gameMode, args[1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user