From 8c669ed8feba76386c8c70697e46697beb5a2a5d Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 15 Mar 2024 15:31:57 +0000 Subject: [PATCH 1/4] fix: NPE when opening key reference panel https://github.com/FTBTeam/FTB-Mods-Issues/issues/1118 --- .../client/gui/quests/KeyReferenceScreen.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/KeyReferenceScreen.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/KeyReferenceScreen.java index 9ec3fbbd..021f0c8b 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/KeyReferenceScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/KeyReferenceScreen.java @@ -10,7 +10,6 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.ComponentContents; import net.minecraft.util.FormattedCharSequence; import org.apache.commons.lang3.tuple.Pair; @@ -150,17 +149,19 @@ private void reflowText() { int maxWidth = getParent().getWidth() - GUTTER_SIZE * 2; reflowed.clear(); for (var entry : data) { - if (entry.getRight().getContents().equals(ComponentContents.EMPTY)) { + if (entry.getRight().getString().isEmpty()) { // header line reflowed.add(Pair.of(entry.getLeft(), null)); h += theme.getFontHeight() + 3; } else { var l = theme.getFont().split(entry.getRight(), maxWidth - 10 - widestL); - reflowed.add(Pair.of(entry.getLeft(), l.get(0))); - for (int i = 1; i < l.size(); i++) { - reflowed.add(Pair.of(Component.empty(), l.get(i))); + if (!l.isEmpty()) { + reflowed.add(Pair.of(entry.getLeft(), l.get(0))); + for (int i = 1; i < l.size(); i++) { + reflowed.add(Pair.of(Component.empty(), l.get(i))); + } + h += (theme.getFontHeight() + 1) * l.size(); } - h += (theme.getFontHeight() + 1) * l.size(); } } From 9f9507e8aa3ca5b54ce8367a77f31069a83f5065 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 15 Mar 2024 15:33:15 +0000 Subject: [PATCH 2/4] build: version -> 2001.3.5, changelog updated --- CHANGELOG.md | 5 +++++ gradle.properties | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95e5d4c6..4b32f51b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2001.3.5] + +### Fixed +* Fixed crash under some circumstances (not always reproducible) when opening the Key Reference panel + ## [2001.3.4] ### Added diff --git a/gradle.properties b/gradle.properties index f29dba7e..229a3e7a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ mod_id=ftbquests archives_base_name=ftb-quests minecraft_version=1.20.1 # Build time -mod_version=2001.3.4 +mod_version=2001.3.5 maven_group=dev.ftb.mods mod_author=FTB Team # Curse release From 75445fb8cd1fe06849707528e328848462cccdf9 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Mon, 18 Mar 2024 10:44:43 +0000 Subject: [PATCH 3/4] fix: shouldDraw() for image buttons really does need to return false! https://github.com/FTBTeam/FTB-Mods-Issues/issues/1119 --- .../ftbquests/client/gui/quests/ChapterImageButton.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterImageButton.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterImageButton.java index ec126eb3..6a4542c2 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterImageButton.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterImageButton.java @@ -128,6 +128,12 @@ public void addMouseOverText(TooltipList list) { chapterImage.addHoverText(list); } + @Override + public boolean shouldDraw() { + // return false here, we'll handle rendering the images ourselves in QuestPanel#drawOffsetBackground + return false; + } + @Override public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) { Icon image = chapterImage.getImage(); @@ -140,7 +146,6 @@ public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) image = image.withColor(chapterImage.getColor().withAlpha(chapterImage.getAlpha())); } -// GuiHelper.setupDrawing(); PoseStack poseStack = graphics.pose(); poseStack.pushPose(); From 3fbda759027ba74ca54b764809a8a193da3d0f02 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Mon, 18 Mar 2024 10:45:32 +0000 Subject: [PATCH 4/4] chore: changelog updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b32f51b..617dc3a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed * Fixed crash under some circumstances (not always reproducible) when opening the Key Reference panel +* Fixed images rendering over and hiding quest dependency lines (bug introduced in last release) ## [2001.3.4]