mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-07 11:37:42 +00:00
Improve player matching in /gamemode
Add extra aliases to /gamemode
This commit is contained in:
parent
bdf67db6ed
commit
f17a790d78
|
@ -1,5 +1,5 @@
|
||||||
annotation.processing.enabled=true
|
annotation.processing.enabled=true
|
||||||
annotation.processing.enabled.in.editor=false
|
annotation.processing.enabled.in.editor=true
|
||||||
annotation.processing.processors.list=lombok.core.AnnotationProcessor
|
annotation.processing.processors.list=lombok.core.AnnotationProcessor
|
||||||
annotation.processing.run.all.processors=false
|
annotation.processing.run.all.processors=false
|
||||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||||
|
|
|
@ -43,8 +43,15 @@ public class Commandgamemode extends EssentialsCommand
|
||||||
user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName()));
|
user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String[] args)
|
private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String[] args) throws NotEnoughArgumentsException
|
||||||
{
|
{
|
||||||
|
//TODO: TL this
|
||||||
|
if (args[1].trim().length() < 2)
|
||||||
|
{
|
||||||
|
throw new NotEnoughArgumentsException("You need to specify a valid player/mode.");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean foundUser = false;
|
||||||
for (Player matchPlayer : server.matchPlayer(args[1]))
|
for (Player matchPlayer : server.matchPlayer(args[1]))
|
||||||
{
|
{
|
||||||
final User player = ess.getUser(matchPlayer);
|
final User player = ess.getUser(matchPlayer);
|
||||||
|
@ -54,6 +61,11 @@ public class Commandgamemode extends EssentialsCommand
|
||||||
}
|
}
|
||||||
performSetMode(args[0].toLowerCase(Locale.ENGLISH), player);
|
performSetMode(args[0].toLowerCase(Locale.ENGLISH), player);
|
||||||
sender.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName()));
|
sender.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName()));
|
||||||
|
foundUser = true;
|
||||||
|
}
|
||||||
|
if (!foundUser)
|
||||||
|
{
|
||||||
|
throw new NotEnoughArgumentsException(_("playerNotFound"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ commands:
|
||||||
gamemode:
|
gamemode:
|
||||||
description: Change player gamemode.
|
description: Change player gamemode.
|
||||||
usage: /<command> <survival|creative|adventure> [player]
|
usage: /<command> <survival|creative|adventure> [player]
|
||||||
aliases: [gm,creative,creativemode,egamemode,ecreative,ecreativemode,egm]
|
aliases: [gm,creative,creativemode,survival,survivalmode,adventure,adventuremode,gmc,gma,gms,egamemod,eecreative,ecreativemode,esurvival,esurvivalmode,eadventure,eadventuremode,egmc,egma,egms,egm]
|
||||||
getpos:
|
getpos:
|
||||||
description: Get your current coordinates or those of a player.
|
description: Get your current coordinates or those of a player.
|
||||||
usage: /<command> [player]
|
usage: /<command> [player]
|
||||||
|
|
Loading…
Reference in a new issue