From cde1153bfdad7e8137d0a4f430630887d06672df Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Thu, 2 Jan 2025 20:41:35 +0100 Subject: [PATCH] Add SettingGroup#getSetting --- .../viafabricplus/api/settings/SettingGroup.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/src/main/java/com/viaversion/viafabricplus/api/settings/SettingGroup.java b/api/src/main/java/com/viaversion/viafabricplus/api/settings/SettingGroup.java index 4e6b5b5f..979656f0 100644 --- a/api/src/main/java/com/viaversion/viafabricplus/api/settings/SettingGroup.java +++ b/api/src/main/java/com/viaversion/viafabricplus/api/settings/SettingGroup.java @@ -21,6 +21,7 @@ package com.viaversion.viafabricplus.api.settings; +import com.viaversion.viafabricplus.util.ChatUtil; import net.minecraft.text.Text; import java.util.ArrayList; @@ -49,6 +50,15 @@ public class SettingGroup { return settings; } + public AbstractSetting getSetting(final String translationKey) { + for (AbstractSetting setting : settings) { + if (ChatUtil.uncoverTranslationKey(setting.getName()).equals(translationKey)) { + return setting; + } + } + return null; + } + public Text getName() { return name; }