mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-06 19:18:25 +01:00
Add SettingGroup#getSetting
This commit is contained in:
parent
0d1b01b2af
commit
cde1153bfd
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user