mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-07 13:03:00 +00:00
Switching the syntax of gamemode /gm mode player and adding mode aliases
Fixing translation keys Fix plugin.yml gamemode syntax
This commit is contained in:
parent
766f9b4dbd
commit
fc288718b7
15 changed files with 300 additions and 287 deletions
|
@ -45,29 +45,29 @@ public class Commandgamemode extends EssentialsCommand
|
|||
|
||||
private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String[] args)
|
||||
{
|
||||
for (Player matchPlayer : server.matchPlayer(args[0]))
|
||||
for (Player matchPlayer : server.matchPlayer(args[1]))
|
||||
{
|
||||
final User player = ess.getUser(matchPlayer);
|
||||
if (player.isHidden())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
performSetMode(args[1], player);
|
||||
performSetMode(args[0], player);
|
||||
sender.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
||||
private void performSetMode(String mode, Player player)
|
||||
{
|
||||
if (mode.contains("survi") || mode.equalsIgnoreCase("0"))
|
||||
if (mode.contains("survi") || mode.equalsIgnoreCase("0") || mode.equalsIgnoreCase("s"))
|
||||
{
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
}
|
||||
else if (mode.contains("creat") || mode.equalsIgnoreCase("1"))
|
||||
else if (mode.contains("creat") || mode.equalsIgnoreCase("1") || mode.equalsIgnoreCase("c"))
|
||||
{
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
else if (mode.contains("advent") || mode.equalsIgnoreCase("2"))
|
||||
else if (mode.contains("advent") || mode.equalsIgnoreCase("2") || mode.equalsIgnoreCase("a"))
|
||||
{
|
||||
player.setGameMode(GameMode.ADVENTURE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue