File tree Expand file tree Collapse file tree
src/main/java/net/wurstclient/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import com .google .gson .JsonParser ;
1212
1313import net .minecraft .util .Util ;
14- import net .wurstclient .command .CmdError ;
1514import net .wurstclient .command .CmdException ;
1615import net .wurstclient .command .CmdSyntaxError ;
1716import net .wurstclient .command .Command ;
@@ -35,22 +34,30 @@ public NameMCCmd()
3534 @ Override
3635 public void call (String [] args ) throws CmdException
3736 {
37+ // must have 1 or more arguments
3838 if (args .length < 1 )
3939 throw new CmdSyntaxError ();
4040
41- final String target = String .join ("" , args );
42-
41+ // look up each target individually
42+ for (String target : args )
43+ {
44+ lookup (target );
45+ }
46+ }
47+
48+ private void lookup (String target )
49+ {
4350 try
4451 {
45- // try getting the uuid just to make sure the user exists (not a
46- // nick)
52+ // try getting the uuid just to make sure the user exists
4753 fetchUUIDFromMojang (target );
4854
49- ChatUtils .message ("Opening profile in the browser..." );
55+ ChatUtils
56+ .message ("Opening profile `" + target + "` in the browser..." );
5057 Util .getOperatingSystem ().open ("https://namemc.com/" + target );
5158 }catch (Exception e )
5259 {
53- throw new CmdError ("Failed to fetch profile" );
60+ ChatUtils . error ("Failed to fetch profile `" + target + "` " );
5461 }
5562 }
5663
You can’t perform that action at this time.
0 commit comments