mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Make commands guess players by nickname
This commit is contained in:
parent
a1047b1811
commit
a696a8b23b
@ -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 New Issue
Block a user