mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-05 23:08:23 +00:00
Fix changing players' gamemodes from the console (#3590)
Fixes #3587 which was introduced by #3337.
This commit is contained in:
parent
2c462106bc
commit
1133770aeb
1 changed files with 2 additions and 1 deletions
|
@ -26,7 +26,7 @@ public class Commandgamemode extends EssentialsLoopCommand {
|
||||||
} else if (args.length == 1) {
|
} else if (args.length == 1) {
|
||||||
loopOnlinePlayersConsumer(server, sender, false, true, args[0], user -> setUserGamemode(sender, matchGameMode(commandLabel), user));
|
loopOnlinePlayersConsumer(server, sender, false, true, args[0], user -> setUserGamemode(sender, matchGameMode(commandLabel), user));
|
||||||
} else if (args.length == 2) {
|
} else if (args.length == 2) {
|
||||||
loopOnlinePlayersConsumer(server, sender, false, true, args[1], user -> setUserGamemode(sender, matchGameMode(commandLabel), user));
|
loopOnlinePlayersConsumer(server, sender, false, true, args[1], user -> setUserGamemode(sender, matchGameMode(args[0]), user));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ public class Commandgamemode extends EssentialsLoopCommand {
|
||||||
|
|
||||||
private GameMode matchGameMode(String modeString) throws NotEnoughArgumentsException {
|
private GameMode matchGameMode(String modeString) throws NotEnoughArgumentsException {
|
||||||
GameMode mode = null;
|
GameMode mode = null;
|
||||||
|
modeString = modeString.toLowerCase();
|
||||||
if (modeString.equalsIgnoreCase("gmc") || modeString.equalsIgnoreCase("egmc") || modeString.contains("creat") || modeString.equalsIgnoreCase("1") || modeString.equalsIgnoreCase("c")) {
|
if (modeString.equalsIgnoreCase("gmc") || modeString.equalsIgnoreCase("egmc") || modeString.contains("creat") || modeString.equalsIgnoreCase("1") || modeString.equalsIgnoreCase("c")) {
|
||||||
mode = GameMode.CREATIVE;
|
mode = GameMode.CREATIVE;
|
||||||
} else if (modeString.equalsIgnoreCase("gms") || modeString.equalsIgnoreCase("egms") || modeString.contains("survi") || modeString.equalsIgnoreCase("0") || modeString.equalsIgnoreCase("s")) {
|
} else if (modeString.equalsIgnoreCase("gms") || modeString.equalsIgnoreCase("egms") || modeString.contains("survi") || modeString.equalsIgnoreCase("0") || modeString.equalsIgnoreCase("s")) {
|
||||||
|
|
Loading…
Reference in a new issue