| 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 { |