Skip to content

Commit

Permalink
Add SettingGroup#getSetting
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Jan 2, 2025
1 parent 0d1b01b commit cde1153
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -49,6 +50,15 @@ public List<AbstractSetting<?>> getSettings() {
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;
}
Expand Down

0 comments on commit cde1153

Please sign in to comment.