mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 07:46:31 +00:00
Make commands guess players by nickname
This commit is contained in:
parent
a1047b1811
commit
a696a8b23b
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,13 @@ public class TFM_Command
|
|||
List<Player> matches = server.matchPlayer(partialname);
|
||||
if (matches.isEmpty())
|
||||
{
|
||||
for(Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if(p.getDisplayName().toLowerCase().indexOf(partialname) != -1)
|
||||
{
|
||||
return p;
|
||||
}
|
||||
}
|
||||
throw new CantFindPlayerException(partialname);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue