diff options
Diffstat (limited to 'src/main/java')
3 files changed, 18 insertions, 9 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java index 2cb01f23..8602ef34 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 - 2023 NotEnoughUpdates contributors + * Copyright (C) 2022-2023 NotEnoughUpdates contributors * * This file is part of NotEnoughUpdates. * diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MuseumPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MuseumPage.java index 0b68f798..4337e2a2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MuseumPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MuseumPage.java @@ -28,6 +28,7 @@ import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -413,7 +414,7 @@ public class MuseumPage extends GuiProfileViewerPage { GL11.GL_NEAREST ); break; - case 8: + default: Utils.drawTexturedRect( guiLeft + 365, guiTop + 100, @@ -426,30 +427,38 @@ public class MuseumPage extends GuiProfileViewerPage { GL11.GL_NEAREST ); startX = guiLeft + 365 + 5; - break; - default: } int startY = guiTop + 100 + 8; int row = 0; int column = 0; + boolean is_five = false; + if (size == 5) { + size = 8; + is_five = true; + } for (int i = 0; i < size; i++) { - JsonObject item = (JsonObject) selectedItem.get(i); + ItemStack stack = new ItemStack(Blocks.barrier); + if (!is_five || i < 5) { + JsonObject item = (JsonObject) selectedItem.get(i); + stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(item, true); + } if (row % 4 == 0 && row > 1) { column = 1; row = 0; } - int x = startX + (column * 18); + int x = startX + (column * 19); int y = startY + (row * 18); - ItemStack stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(item, true); Utils.drawItemStack(stack, x, y); if ((mouseX >= x && mouseX <= x + 16) && (mouseY >= y && mouseY <= y + 16)) { - getInstance().tooltipToDisplay = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + if (!is_five || i < 5) { + getInstance().tooltipToDisplay = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + } } row++; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/EssenceTaskLevel.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/EssenceTaskLevel.java index 105c7056..77d6589c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/EssenceTaskLevel.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/EssenceTaskLevel.java @@ -46,7 +46,7 @@ public class EssenceTaskLevel extends GuiTaskLevel { JsonObject categoryXp = levelPage.getConstant().get("category_xp").getAsJsonObject(); JsonObject essenceShopTask = levelPage.getConstant().get("essence_shop_task").getAsJsonObject(); JsonArray essenceSteps = essenceShopTask.get("essence_shop_xp").getAsJsonArray(); - JsonObject essencePerks = object.get("perks").getAsJsonObject(); + JsonObject essencePerks = object.has("perks") ? object.get("perks").getAsJsonObject() : new JsonObject(); Map<String, EssenceShop> loreMap = new HashMap<>(); for (Map.Entry<String, JsonElement> stringJsonElementEntry : Constants.ESSENCESHOPS.entrySet()) { |