5757class TransformCache {
5858 private final Path root ;
5959 private final Map <ModLoadOption , Path > modRoots = new HashMap <>();
60- private final List <ModLoadOption > orderedMods ;
60+ private final List <ModLoadOption > allMods ;
61+ private final List <ModLoadOption > modsInCache ;
6162 private final Map <String , String > hiddenClasses = new HashMap <>();
6263 private static final boolean COPY_ON_WRITE = true ;
6364
6465 public TransformCache (Path root , List <ModLoadOption > orderedMods ) {
6566 this .root = root ;
66- this .orderedMods = orderedMods .stream ().filter (mod -> mod .needsTransforming () && !QuiltLoaderImpl .MOD_ID .equals (mod .id ())).collect (Collectors .toList ());
67+ this .allMods = orderedMods ;
68+ this .modsInCache = orderedMods .stream ().filter (mod -> mod .needsTransforming () && !QuiltLoaderImpl .MOD_ID .equals (mod .id ())).collect (Collectors .toList ());
6769
68- for (ModLoadOption mod : this .orderedMods ) {
70+ for (ModLoadOption mod : this .modsInCache ) {
6971 Path modSrc = mod .createTransformRoot ();
7072 Path modDst = root .resolve (mod .id ());
7173 modRoots .put (mod , modDst );
@@ -152,7 +154,7 @@ public TransformCache(Path root, List<ModLoadOption> orderedMods) {
152154 }
153155 // Populate mods that need remapped
154156 RuntimeModRemapper .remap (this );
155- for (ModLoadOption orderedMod : this .orderedMods ) {
157+ for (ModLoadOption orderedMod : this .modsInCache ) {
156158 modRoots .put (orderedMod , root .resolve (orderedMod .id () + "/" ));
157159 }
158160 }
@@ -161,8 +163,14 @@ public Path getRoot(ModLoadOption mod) {
161163 return modRoots .get (mod );
162164 }
163165
164- public List <ModLoadOption > getMods () {
165- return Collections .unmodifiableList (orderedMods );
166+ /** @return Every mod which has a {@link #getRoot(ModLoadOption)} in this cache. */
167+ public List <ModLoadOption > getModsInCache () {
168+ return Collections .unmodifiableList (modsInCache );
169+ }
170+
171+ /** @return The original list of mods, including any which aren't directly in this cache. */
172+ public List <ModLoadOption > getAllMods () {
173+ return Collections .unmodifiableList (allMods );
166174 }
167175
168176 public Map <String , String > getHiddenClasses () {
@@ -171,7 +179,7 @@ public Map<String, String> getHiddenClasses() {
171179
172180 public void forEachClassFile (ClassConsumer action )
173181 throws IOException {
174- for (ModLoadOption mod : orderedMods ) {
182+ for (ModLoadOption mod : modsInCache ) {
175183 visitFolder (mod , getRoot (mod ), action );
176184 }
177185 }
0 commit comments