Update buildscript & apply automatic formatting rules

This commit is contained in:
Raven Szewczyk authored and Jason Mitchell committed 2022-06-27 10:23:18 -07:00
1 parent a7683b885d
commit f7a900e910
173 files changed
+4581 -5321

No files matched your search

@@ -2,18 +2,15 @@ package codechicken.nei.config;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.config.GuiOptionList.OptionScrollSlot;
import java.util.ArrayList;
import java.util.HashMap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import java.util.ArrayList;
import java.util.HashMap;
public class OptionList extends OptionButton
{
public class OptionList extends OptionButton {
public static final OptionList root = new RootOptionList();
private static class RootOptionList extends OptionList
{
private static class RootOptionList extends OptionList {
public RootOptionList() {
super(null);
}
@@ -41,21 +38,18 @@ public class OptionList extends OptionButton
public static OptionList getOptionList(String fullName) {
Option o = root.getOption(fullName);
if (o == null)
root.addOption(o = new OptionList(fullName));
if (o == null) root.addOption(o = new OptionList(fullName));
return (OptionList) o;
}
public static void setOptionList(OptionList list) {
OptionList prev = (OptionList) root.getOption(list.fullName());
if (prev == null)
root.addOption(list);
if (prev == null) root.addOption(list);
else {
list.parent = prev.parent;
list.options = prev.options;
list.optionList = prev.optionList;
for (Option o : list.optionList)
o.parent = list;
for (Option o : list.optionList) o.parent = list;
list.parent.options.put(list.fullName(), list);
list.parent.optionList.remove(prev);
list.parent.addSorted(list);
@@ -64,8 +58,7 @@ public class OptionList extends OptionButton
public static String parent(String fullName) {
int i = fullName.indexOf('.');
if (i < 0)
return fullName;
if (i < 0) return fullName;
return fullName.substring(0, i);
}
@@ -83,15 +76,13 @@ public class OptionList extends OptionButton
private OptionList subList(String fullName) {
OptionList o = (OptionList) getOption(fullName);
if (o == null)
addOption(o = new OptionList(fullName));
if (o == null) addOption(o = new OptionList(fullName));
return o;
}
public Option getOption(String fullName) {
if (fullName.contains("."))
return subList(parent(fullName)).getOption(child(fullName));
if (fullName.contains(".")) return subList(parent(fullName)).getOption(child(fullName));
return options.get(fullName);
}
@@ -107,8 +98,7 @@ public class OptionList extends OptionButton
return;
}
if (options.containsKey(subName))
NEIClientConfig.logger.warn("Replacing option: " + fullName);
if (options.containsKey(subName)) NEIClientConfig.logger.warn("Replacing option: " + fullName);
options.put(subName, o);
addSorted(o);