From 1b6b70610fb2b486ecca664806b57b949526b388 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 5 Aug 2022 19:46:47 +0200 Subject: Pv hide offline location (#200) * hide location text "unknown" in pv page when the player is offline * fixed the pr Co-authored-by: nopo --- .../notenoughupdates/profileviewer/GuiProfileViewer.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index e3a2091f..455bbf36 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -4656,16 +4656,24 @@ public class GuiProfileViewer extends GuiScreen { String locationStr = null; if (profile.getUuid().equals("20934ef9488c465180a78f861586b4cf")) { locationStr = "Ignoring DMs"; - } else if(profile.getUuid().equals("b876ec32e396476ba1158438d83c67d4")) { + } else if (profile.getUuid().equals("b876ec32e396476ba1158438d83c67d4")) { statusStr = EnumChatFormatting.LIGHT_PURPLE + "Long live Potato King"; ItemStack potato_crown = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager .getItemInformation() .get("POTATO_CROWN")); potato_crown.addEnchantment(Enchantment.unbreaking, 1656638942); // this number may be useful - Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Items.potato), guiLeft + 35, guiTop + 160); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI( + new ItemStack(Items.potato), + guiLeft + 35, + guiTop + 160 + ); Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(potato_crown, guiLeft + 50, guiTop + 162); - Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Items.potato), guiLeft + 63, guiTop + 160); - } else { + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI( + new ItemStack(Items.potato), + guiLeft + 63, + guiTop + 160 + ); + } else if (online) { locationStr = NotEnoughUpdates.INSTANCE.navigation.getNameForAreaModeOrUnknown(location); } if (locationStr != null) { -- cgit