Add SettingGroup#getSetting

This commit is contained in:
FlorianMichael 2025-01-02 20:41:35 +01:00
parent 0d1b01b2af
commit cde1153bfd
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -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;
}