(File mclocation)
| 89 | public LinkedHashMap<String, Boolean> transformers = new LinkedHashMap<>(); // To keep insertion order |
| 90 | |
| 91 | public ASMConfig(File mclocation) { |
| 92 | dirty = false; |
| 93 | // Shouldn't happen, but sanity, and Java can't enforce this unlike decent programming languages... |
| 94 | if (mclocation == null) throw new RuntimeException("Failed to acquire `location` in GT6 CoreMod"); |
| 95 | |
| 96 | transformers.put(MultiPart_FixLoggerCrash.class.getName(), true); |
| 97 | transformers.put(MicroBlock_FixLoggerCrash.class.getName(), true); |
| 98 | transformers.put(CoFHCore_CrashFix.class.getName(), true); |
| 99 | transformers.put(CoFHLib_HashFix.class.getName(), true); |
| 100 | transformers.put(ExtraUtils_FixThaumcraftAspects.class.getName(), true); |
| 101 | transformers.put(Minecraft_EmptyRecipeOptimization.class.getName(), true); |
| 102 | transformers.put(Minecraft_Feature_CreeperSwellToward.class.getName(), true); |
| 103 | transformers.put(Minecraft_IceHarvestMissingHookFix.class.getName(), true); |
| 104 | transformers.put(Minecraft_LavaFlammableFix.class.getName(), true); |
| 105 | // TODO transformers.put(Minecraft_MinecraftServerIntegratedLaunchMainMenuPartialFix.class.getName(), true); |
| 106 | transformers.put(Minecraft_RemoveCartSpeedCap.class.getName(), true); |
| 107 | transformers.put(Minecraft_ZombieVillagerConversion.class.getName(), true); |
| 108 | transformers.put(Railcraft_RemoveBoreSpam.class.getName(), true); |
| 109 | transformers.put(Technomancy_ExtremelySlowLoadFix.class.getName(), true); |
| 110 | transformers.put(Thaumcraft_AspectLagFix.class.getName(), true); |
| 111 | |
| 112 | mclocation = new File(mclocation, "/config/gregtech"); |
| 113 | mclocation.mkdirs(); |
| 114 | mclocation = new File(mclocation, "/asm.ini"); |
| 115 | if (!mclocation.exists()) { |
| 116 | try { |
| 117 | PrintWriter out = new PrintWriter(mclocation); |
| 118 | outputConfig(out); |
| 119 | out.close(); |
| 120 | } catch (FileNotFoundException e) { |
| 121 | throw new RuntimeException("Unable to write GT6 ASM config file at: " + mclocation, e); |
| 122 | } catch (IOException e) { |
| 123 | throw new RuntimeException("Unable to write to GT6 ASM config file at: " + mclocation, e); |
| 124 | } |
| 125 | } else { |
| 126 | try { |
| 127 | BufferedReader in = new BufferedReader(new FileReader(mclocation)); |
| 128 | loadConfig(in); |
| 129 | in.close(); |
| 130 | if (dirty) { |
| 131 | PrintWriter out = new PrintWriter(mclocation); |
| 132 | outputConfig(out); |
| 133 | out.close(); |
| 134 | } |
| 135 | } catch (IOException e) { |
| 136 | throw new RuntimeException("Error reading GT6 ASM config file at: " + mclocation, e); |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | private void outputConfig(Writer out) throws IOException { |
| 142 | out.write("# ASM Transformers, `true` to enable, `false` to disable\n"); |
nothing calls this directly
no test coverage detected