From 0a7a3dc295ca1490f26d7681b4e1a330d36008dd Mon Sep 17 00:00:00 2001 From: Leo-MathGuy Date: Thu, 25 Apr 2024 20:03:38 +0500 Subject: [PATCH] Revert 3 commits --- core/src/mindustry/mod/Mods.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 53acdc91c9..c31f648637 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -738,14 +738,18 @@ public class Mods implements Loadable{ Fi folder = contentRoot.child(lower + (lower.endsWith("s") ? "" : "s")); if(folder.exists()){ for(Fi file : folder.findAll(f -> f.extension().equals("json") || f.extension().equals("hjson"))){ - currentRun.put(file.nameWithoutExtension(), new LoadRun(type, file, mod)); + if(contentOrder == null){ + runs.add(new LoadRun(type, file, mod)); + }else{ + currentRun.put(file.nameWithoutExtension(), new LoadRun(type, file, mod)); + } } } } } + Seq left = currentRun.keys().toSeq(); if(contentOrder != null){ - Seq left = currentRun.keys().toSeq(); for (String contentName : contentOrder){ LoadRun run = currentRun.get(contentName); if(run != null){ @@ -755,10 +759,9 @@ public class Mods implements Loadable{ Log.warn("Cannot find content defined in contentOrder: @", contentName); } } - runs.addAll(left.map(name -> currentRun.get(name))); - }else{ - runs.addAll(currentRun.values().toSeq()); } + + runs.addAll(left.map(name -> currentRun.get(name)).sort()); } for(LoadRun l : runs){