mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-22 21:42:44 +01:00
Add SettingGroup#getSetting
This commit is contained in:
parent
0d1b01b2af
commit
cde1153bfd
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
package com.viaversion.viafabricplus.api.settings;
|
package com.viaversion.viafabricplus.api.settings;
|
||||||
|
|
||||||
|
import com.viaversion.viafabricplus.util.ChatUtil;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -49,6 +50,15 @@ public class SettingGroup {
|
|||||||
return settings;
|
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() {
|
public Text getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user