diff options
author | Raven Szewczyk <git@eigenraven.me> | 2022-08-27 10:19:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 11:19:57 +0200 |
commit | 6f31720697bcc351421a4d86ba3bf749375dd12c (patch) | |
tree | 3adf8f318f22c892d74cd7c9d30b6dd3f11f11bd /src/main/java/gregtech/client/GT_GUI_ClientConfig.java | |
parent | c3eac50decd33ee2be8703dfb2ecf9cdc31c2b67 (diff) | |
download | GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.gz GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.bz2 GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.zip |
Update buildscript & apply spotless (#1306)
* Update dependencies
* Update buildscript, apply spotless
Diffstat (limited to 'src/main/java/gregtech/client/GT_GUI_ClientConfig.java')
-rw-r--r-- | src/main/java/gregtech/client/GT_GUI_ClientConfig.java | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/src/main/java/gregtech/client/GT_GUI_ClientConfig.java b/src/main/java/gregtech/client/GT_GUI_ClientConfig.java index 436be7d1df..6c3c174044 100644 --- a/src/main/java/gregtech/client/GT_GUI_ClientConfig.java +++ b/src/main/java/gregtech/client/GT_GUI_ClientConfig.java @@ -3,42 +3,48 @@ package gregtech.client; import cpw.mods.fml.client.config.GuiConfig; import cpw.mods.fml.client.config.IConfigElement; import gregtech.api.GregTech_API; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.ConfigElement; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - public class GT_GUI_ClientConfig extends GuiConfig { - public GT_GUI_ClientConfig(GuiScreen parentScreen) { - super(parentScreen, getConfigElements(), "gregtech", "client", false, false, getAbridgedConfigPath(GregTech_API.sClientDataFile.mConfig.toString())); - } + public GT_GUI_ClientConfig(GuiScreen parentScreen) { + super( + parentScreen, + getConfigElements(), + "gregtech", + "client", + false, + false, + getAbridgedConfigPath(GregTech_API.sClientDataFile.mConfig.toString())); + } - @SuppressWarnings("rawtypes") - private static List<IConfigElement> getConfigElements() { - final Configuration config = GregTech_API.sClientDataFile.mConfig; - setLanguageKeys(config); - return config.getCategoryNames().stream() - .filter(name -> name.indexOf('.') == -1) - .map(name -> new ConfigElement(config.getCategory(name))) - .collect(Collectors.toList()); - } + @SuppressWarnings("rawtypes") + private static List<IConfigElement> getConfigElements() { + final Configuration config = GregTech_API.sClientDataFile.mConfig; + setLanguageKeys(config); + return config.getCategoryNames().stream() + .filter(name -> name.indexOf('.') == -1) + .map(name -> new ConfigElement(config.getCategory(name))) + .collect(Collectors.toList()); + } - private static void setLanguageKeys(Configuration config) { - for (String categoryName : config.getCategoryNames()) { - ConfigCategory category = config.getCategory(categoryName); - category.setLanguageKey("GT5U.config." + categoryName); - for (Map.Entry<String, Property> entry : category.entrySet()) { - // drop the default value in name - String name = entry.getKey(); - int defaultStart = name.lastIndexOf('_'); - String realName = defaultStart >= 0 ? name.substring(0, defaultStart) : name; - entry.getValue().setLanguageKey(String.format("%s.%s", category.getLanguagekey(), realName)); - } - } - } + private static void setLanguageKeys(Configuration config) { + for (String categoryName : config.getCategoryNames()) { + ConfigCategory category = config.getCategory(categoryName); + category.setLanguageKey("GT5U.config." + categoryName); + for (Map.Entry<String, Property> entry : category.entrySet()) { + // drop the default value in name + String name = entry.getKey(); + int defaultStart = name.lastIndexOf('_'); + String realName = defaultStart >= 0 ? name.substring(0, defaultStart) : name; + entry.getValue().setLanguageKey(String.format("%s.%s", category.getLanguagekey(), realName)); + } + } + } } |