From 801a23f7a0dede3e23fa510553bdc35dde70738a Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Thu, 27 Jun 2024 07:35:05 +0100 Subject: [PATCH 1/4] fix: clear display cache message needs to use the unit instance https://github.com/FTBTeam/FTB-Mods-Issues/issues/1243 --- .../dev/ftb/mods/ftbquests/net/ClearDisplayCacheMessage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/net/ClearDisplayCacheMessage.java b/common/src/main/java/dev/ftb/mods/ftbquests/net/ClearDisplayCacheMessage.java index 08e210f2..c68a5e93 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/net/ClearDisplayCacheMessage.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/net/ClearDisplayCacheMessage.java @@ -34,8 +34,7 @@ public static void handle(ClearDisplayCacheMessage message, NetworkManager.Packe public static void clearForAll(MinecraftServer server) { if (server != null) { - ClearDisplayCacheMessage msg = new ClearDisplayCacheMessage(); - NetworkHelper.sendToAll(server, msg); + NetworkHelper.sendToAll(server, ClearDisplayCacheMessage.INSTANCE); } } } From 27dc8ce75010fdd17a71cd58f5e89149aed8a17e Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Thu, 27 Jun 2024 09:26:05 +0100 Subject: [PATCH 2/4] fix: some raw json text in quest descriptions was not being recognised https://github.com/FTBTeam/FTB-Mods-Issues/issues/1239 --- .../ftb/mods/ftbquests/util/TextUtils.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/util/TextUtils.java b/common/src/main/java/dev/ftb/mods/ftbquests/util/TextUtils.java index 7c79585c..db0145bc 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/util/TextUtils.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/util/TextUtils.java @@ -1,40 +1,40 @@ package dev.ftb.mods.ftbquests.util; import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; import dev.ftb.mods.ftblibrary.util.client.ClientTextComponentUtils; import net.minecraft.ChatFormatting; import net.minecraft.core.HolderLookup; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; -import net.minecraft.nbt.TagType; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import java.util.ArrayList; import java.util.List; -import java.util.regex.Pattern; public class TextUtils { - private static final Pattern JSON_TEXT_PATTERN = Pattern.compile("^[{\\[]\\s*\""); - /** - * Parse some rich text into a Component. Use vanilla-style raw JSON if possible, fall back to old-style FTB + * Parse some rich text into a Component. Use vanilla-style raw JSON if applicable, fall back to old-style FTB * Quests rich text otherwise. (FTB Quests rich text is more concise, raw JSON is much more powerful) * * @param str the raw string to parse * @return a component, which could be the error message if parsing failed */ public static Component parseRawText(String str, HolderLookup.Provider provider) { - return JSON_TEXT_PATTERN.matcher(str).find() ? - deserializeRawJsonText(str, provider) : - ClientTextComponentUtils.parse(str); - } + String str2 = str.trim(); + if (str2.startsWith("[") && str2.endsWith("]") || str2.startsWith("{") && str2.endsWith("}")) { + // could be JSON raw text, but not for definite... + try { + MutableComponent res = Component.Serializer.fromJson(str2, provider); + if (res != null) { + return res; + } + } catch (JsonParseException ignored) { - private static Component deserializeRawJsonText(String raw, HolderLookup.Provider provider) { - try { - return Component.Serializer.fromJson(raw, provider); - } catch (JsonParseException e) { - return Component.literal("ERROR: " + e.getMessage()).withStyle(ChatFormatting.RED); + } } + return ClientTextComponentUtils.parse(str); } public static List fromListTag(ListTag tag) { From 8fb3b40547b5dec9dac65a6d98894a9143d881cb Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 28 Jun 2024 14:48:57 +0100 Subject: [PATCH 3/4] chore: remove some unnecessary code from RewardButton.java --- .../ftb/mods/ftbquests/client/gui/quests/RewardButton.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/RewardButton.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/RewardButton.java index e8e7dc42..ea1dd0f1 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/RewardButton.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/RewardButton.java @@ -77,10 +77,6 @@ public void addMouseOverText(TooltipList list) { } } else { reward.addMouseOverText(list); - - if (!list.shouldRender()) { - list.zOffset = 580; - } } } From 86dc5b04cdf505f173db70e5441911cc731f87ad Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 28 Jun 2024 14:49:31 +0100 Subject: [PATCH 4/4] build: version -> 2100.1.2, updated neo & arch dep versions changelog updated --- CHANGELOG.md | 7 +++++++ gradle.properties | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54993d3a..4935275b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ 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). +# [2100.1.2] + +### Fixed +* Fixed raw json text in quest descriptions not always being recognised +* Fixed a packet sync error related to translation system when on dedicated server +* Chapter filenames are now again named after the chapter title (at the time of creation), as they used to be in 1.20 and earlier + # [2100.1.1] ### Fixed diff --git a/gradle.properties b/gradle.properties index 15d996bc..a14baed9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,21 +9,21 @@ maven_group=dev.ftb.mods mod_author=FTB Team # Build time -mod_version=2100.1.1 +mod_version=2100.1.2 minecraft_version=1.21 # Cross env #forge_version=50.0.9 #forge_loader_version=49 -neoforge_version=21.0.21-beta +neoforge_version=21.0.40-beta # https://maven.neoforged.net/#/releases/net/neoforged/fancymodloader/loader neoforge_loader_version=4 fabric_loader_version=0.15.11 fabric_api_version=0.100.1+1.21 -architectury_api_version=13.0.1 +architectury_api_version=13.0.2 -ftb_library_version=2100.1.1 +ftb_library_version=2100.1.2 ftb_teams_version=2100.1.0 # Optional deps