From 9dfff3e4db5b77a720d624ad5febda44f287e838 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Tue, 24 Aug 2021 21:23:11 +0200 Subject: Update GuiProfileViewer.java --- .../profileviewer/GuiProfileViewer.java | 51 ++++++++++++---------- 1 file changed, 29 insertions(+), 22 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 11a5574d..115660c7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1398,7 +1398,6 @@ public class GuiProfileViewer extends GuiScreen { if(tag.hasKey("display", 10)) { NBTTagCompound display = tag.getCompoundTag("display"); if(display.hasKey("Lore", 9)) { - NBTTagList newNewLore = new NBTTagList(); NBTTagList newLore = new NBTTagList(); NBTTagList lore = display.getTagList("Lore", 8); HashMap blankLocations = new HashMap<>(); @@ -1429,37 +1428,45 @@ public class GuiProfileViewer extends GuiScreen { } } } - if(heldItemJson != null && secondLastBlank != null) { - for(int j=0; j2) { + } else if (blanks == 2) { + System.out.println(heldItemLine); + temp.appendTag(new NBTTagString(heldItemLine)); + } else if (blanks > 2) { break; } } + temp.appendTag(new NBTTagString()); } - - newNewLore.appendTag(new NBTTagString(line)); + if (candy != 0) { + temp.appendTag(new NBTTagString(EnumChatFormatting.GREEN + "(" + candy + "/10) Pet Candy Used")); + temp.appendTag(new NBTTagString()); + } + temp.removeTag(temp.tagCount() - 1); } - display.setTag("Lore", newNewLore); - } else { - display.setTag("Lore", newLore); - } - if(candy != 0){ - newLore.appendTag(new NBTTagString()); - newLore.appendTag(new NBTTagString(EnumChatFormatting.GREEN + "(" + candy + "/10) Pet Candy Used")); } + newLore = temp; + display.setTag("Lore", newLore); } if(display.hasKey("Name", 8)) { String displayName = display.getString("Name"); -- cgit