File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
common/src/main/java/org/embeddedt/modernfix/core/config Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2525import java .util .function .BooleanSupplier ;
2626import java .util .regex .Pattern ;
2727import java .util .stream .Collectors ;
28+ import java .util .stream .Stream ;
29+ import java .util .stream .StreamSupport ;
2830
2931public class ModernFixEarlyConfig {
3032 private static final Logger LOGGER = LogManager .getLogger ("ModernFixConfig" );
@@ -84,7 +86,10 @@ private void scanForAndBuildMixinOptions() {
8486 continue ;
8587 try (Reader reader = new BufferedReader (new InputStreamReader (stream , StandardCharsets .UTF_8 ))) {
8688 JsonObject configObject = (JsonObject )new JsonParser ().parse (reader );
87- JsonArray mixinList = configObject .getAsJsonArray ("mixins" );
89+ List <JsonElement > mixinList = Stream .of ("mixins" , "client" )
90+ .map (key -> Optional .ofNullable (configObject .getAsJsonArray (key )))
91+ .flatMap (arr -> arr .map (jsonElements -> StreamSupport .stream (jsonElements .spliterator (), false )).orElseGet (Stream ::of ))
92+ .collect (Collectors .toList ());
8893 String packageName = configObject .get ("package" ).getAsString ().replace ('.' , '/' );
8994 for (JsonElement mixin : mixinList ) {
9095 mixinPaths .add (packageName + "/" + mixin .getAsString ().replace ('.' , '/' ) + ".class" );
You can’t perform that action at this time.
0 commit comments