MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / loadConfig

Method loadConfig

src/main/java/gregtech/asm/GT_ASM.java:148–177  ·  view source on GitHub ↗
(BufferedReader in)

Source from the content-addressed store, hash-verified

146 }
147
148 private void loadConfig(BufferedReader in) throws IOException {
149 int lineno = 0;
150 int transformersInserted = 0;
151 String line;
152 while ( (line = in.readLine()) != null) {
153 line = line.trim();
154 lineno += 1;
155 if (line.startsWith("transformer:")) {
156 String kw = line.substring(12);
157 String[] kwa = kw.split("=");
158 if (kwa.length != 2) throw new RuntimeException("Invalid Configuration entry in GT6 ASM configuration file, line " + lineno + ": " + line);
159 String classname = kwa[0].trim();
160 boolean enabled = !kwa[1].contains("false");
161 if (transformers.containsKey(classname)) {
162 transformers.put(classname, enabled);
163 transformersInserted += 1;
164 } else {
165 FMLRelaunchLog.warning("Invalid configuration entry classname of %s at line %s", classname, Integer.toString(lineno));
166 dirty = true;
167 }
168 } else if (line.startsWith("#")) {
169 // skip
170 } else if (line.trim().equals("")) {
171 // skip
172 } else {
173 dirty = true;
174 }
175 }
176 if (transformersInserted != transformers.size()) dirty = true;
177 }
178 }
179
180 static class PrinterClassVisitor extends ClassVisitor {

Callers 1

ASMConfigMethod · 0.95

Calls 6

containsKeyMethod · 0.80
containsMethod · 0.65
putMethod · 0.45
toStringMethod · 0.45
equalsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected