diff options
| author | Moulberry <james.jenour@student.scotch.wa.edu.au> | 2020-08-30 02:51:50 +1000 |
|---|---|---|
| committer | Moulberry <james.jenour@student.scotch.wa.edu.au> | 2020-08-30 02:51:50 +1000 |
| commit | 79894d22b49f943bcbedb22b9d515eb3db622886 (patch) | |
| tree | 765311480ec71388dd837f7aca61e0ae8ceafac1 /src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java | |
| parent | a5f669c4ec0692efd0e532d23156ea260718c0ee (diff) | |
| download | notenoughupdates-79894d22b49f943bcbedb22b9d515eb3db622886.tar.gz notenoughupdates-79894d22b49f943bcbedb22b9d515eb3db622886.tar.bz2 notenoughupdates-79894d22b49f943bcbedb22b9d515eb3db622886.zip | |
1.2.4
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 597beca2..ab0de3cb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -220,16 +220,17 @@ public class NotEnoughUpdates { ScheduledExecutorService peekCommandExecutorService = null; SimpleCommand peekCommand = new SimpleCommand("peek", new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { + String name; if(args.length == 0) { - sender.addChatMessage(new ChatComponentText( - EnumChatFormatting.RED+"[PEEK] Usage: /peek (username)")); - return; + name = Minecraft.getMinecraft().thePlayer.getName(); + } else { + name = args[0]; } int id = new Random().nextInt(Integer.MAX_VALUE/2)+Integer.MAX_VALUE/2; Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText( EnumChatFormatting.YELLOW+"[PEEK] Getting player information..."), id); - profileViewer.getProfileByName(args[0], profile -> { + profileViewer.getProfileByName(name, profile -> { if (profile == null) { Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText( EnumChatFormatting.RED+"[PEEK] Unknown player or api is down."), id); @@ -264,14 +265,14 @@ public class NotEnoughUpdates { if(profileInfo != null) { float overallScore = 0; - boolean isMe = args[0].equalsIgnoreCase("moulberry"); + boolean isMe = name.equalsIgnoreCase("moulberry"); PlayerStats.Stats stats = profile.getStats(null); JsonObject skill = profile.getSkillInfo(null); Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(EnumChatFormatting.GREEN+" "+ EnumChatFormatting.STRIKETHROUGH+"-=-" +EnumChatFormatting.RESET+EnumChatFormatting.GREEN+" "+ - Utils.getElementAsString(profile.getHypixelProfile().get("displayname"), args[0]) + "'s Info " + + Utils.getElementAsString(profile.getHypixelProfile().get("displayname"), name) + "'s Info " + EnumChatFormatting.STRIKETHROUGH+"-=-"), id); if(skill == null) { |
