From c8fe1a62cf6593204a30ab1e0e0495fb42bb1fd4 Mon Sep 17 00:00:00 2001 From: woodiertexas Date: Fri, 11 Aug 2023 02:02:28 -0700 Subject: [PATCH 1/3] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index acd7a32..4b1fbd8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G org.gradle.parallel = true # Mod Properties -version = 3.4.1+1.20.1 +version = 3.4.2+1.20.1 maven_group = io.github.debuggyteam archives_base_name = architecture_extensions From 00cecfb17e426b8afcbdb1a641d464181ac16512 Mon Sep 17 00:00:00 2001 From: Falkreon Date: Fri, 11 Aug 2023 04:29:23 -0500 Subject: [PATCH 2/3] Remove caching from localization keys. Fixes #48 --- .../TypedGroupedBlockItem.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/main/java/io/github/debuggyteam/architecture_extensions/TypedGroupedBlockItem.java b/src/main/java/io/github/debuggyteam/architecture_extensions/TypedGroupedBlockItem.java index b15a6ef..be283d7 100644 --- a/src/main/java/io/github/debuggyteam/architecture_extensions/TypedGroupedBlockItem.java +++ b/src/main/java/io/github/debuggyteam/architecture_extensions/TypedGroupedBlockItem.java @@ -21,9 +21,6 @@ public class TypedGroupedBlockItem extends BlockItem implements TypedGrouped { protected final TypedGroupedBlock typedGroupedBlock; - @ClientOnly - protected Text cachedLocalization = null; - public TypedGroupedBlockItem(T block, Settings settings) { super(block, settings); typedGroupedBlock = block.getTypedGroupedBlock(); @@ -57,21 +54,16 @@ private Text getBaseTranslationKey() { @Override @ClientOnly public Text getName() { - if (cachedLocalization == null) { + String translationKey = Util.createTranslationKey("block", Registries.ITEM.getId(this)); + if (I18n.hasTranslation(translationKey)) { + return Text.translatable(translationKey); + } else { + Text baseBlock = getBaseTranslationKey(); + String typedGroupedKey = BLOCK_TYPE_PREFIX + "." + typedGroupedBlock.type().toString(); + Text blockType = Text.translatable(typedGroupedKey); - String translationKey = Util.createTranslationKey("block", Registries.ITEM.getId(this)); - if (I18n.hasTranslation(translationKey)) { - cachedLocalization = Text.translatable(translationKey); - } else { - Text baseBlock = getBaseTranslationKey(); - String typedGroupedKey = BLOCK_TYPE_PREFIX + "." + typedGroupedBlock.type().toString(); - Text blockType = Text.translatable(typedGroupedKey); - - cachedLocalization = Text.translatable(BLOCKTYPE_BLOCK_KEY, baseBlock, blockType); - } + return Text.translatable(BLOCKTYPE_BLOCK_KEY, baseBlock, blockType); } - - return cachedLocalization; } @Override From 2a2691ee401b2d6bf057657e338579ec552bd5d8 Mon Sep 17 00:00:00 2001 From: woodiertexas Date: Fri, 11 Aug 2023 02:34:11 -0700 Subject: [PATCH 3/3] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4b1fbd8..64e4e70 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G org.gradle.parallel = true # Mod Properties -version = 3.4.2+1.20.1 +version = 3.4.3+1.20.1 maven_group = io.github.debuggyteam archives_base_name = architecture_extensions