mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 21:22:09 +00: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
1 changed files with 14 additions and 4 deletions
|
@ -19,12 +19,22 @@ public class Commandgamemode extends EssentialsCommand
|
||||||
@Override
|
@Override
|
||||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
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();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
GameMode gameMode = matchGameMode(args[0].toLowerCase(Locale.ENGLISH));
|
else if (args.length == 1)
|
||||||
gamemodeOtherPlayers(server, sender, gameMode, args[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
|
@Override
|
||||||
|
@ -41,7 +51,7 @@ public class Commandgamemode extends EssentialsCommand
|
||||||
gamemodeOtherPlayers(server, user, gameMode, args[1]);
|
gamemodeOtherPlayers(server, user, gameMode, args[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue