diff --git a/gradle.properties b/gradle.properties index 19b486762..9ac1693b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ group = org.quiltmc description = The mod loading component of Quilt url = https://github.com/quiltmc/quilt-loader # Don't forget to change this in QuiltLoaderImpl as well -quilt_loader = 0.24.1-beta.1 +quilt_loader = 0.24.1-beta.2 # Fabric & Quilt Libraries asm = 9.6 diff --git a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java index 2bb823c60..58a9ef28e 100644 --- a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java +++ b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java @@ -132,7 +132,7 @@ public final class QuiltLoaderImpl { public static final int ASM_VERSION = Opcodes.ASM9; - public static final String VERSION = "0.24.1-beta.1"; + public static final String VERSION = "0.24.1-beta.2"; public static final String MOD_ID = "quilt_loader"; public static final String DEFAULT_MODS_DIR = "mods"; public static final String DEFAULT_CACHE_DIR = ".cache"; diff --git a/src/main/java/org/quiltmc/loader/impl/transformer/ChasmInvoker.java b/src/main/java/org/quiltmc/loader/impl/transformer/ChasmInvoker.java index 3ed98e0bb..3fb20ccc0 100644 --- a/src/main/java/org/quiltmc/loader/impl/transformer/ChasmInvoker.java +++ b/src/main/java/org/quiltmc/loader/impl/transformer/ChasmInvoker.java @@ -69,7 +69,7 @@ static void applyChasm0(TransformCache cache) throws IOException { Map inputClassCache = new HashMap<>(); // TODO: Move chasm searching to here! - for (ModLoadOption mod : cache.getMods()) { + for (ModLoadOption mod : cache.getModsInCache()) { Path path2 = cache.getRoot(mod); if (!FasterFiles.isDirectory(path2)) { continue; @@ -108,7 +108,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO } }); - for (ModLoadOption mod : cache.getMods()) { + for (ModLoadOption mod : cache.getModsInCache()) { Path modPath = cache.getRoot(mod); if (!FasterFiles.exists(modPath)) { continue; diff --git a/src/main/java/org/quiltmc/loader/impl/transformer/QuiltTransformer.java b/src/main/java/org/quiltmc/loader/impl/transformer/QuiltTransformer.java index 29acd7c99..3b6a55409 100644 --- a/src/main/java/org/quiltmc/loader/impl/transformer/QuiltTransformer.java +++ b/src/main/java/org/quiltmc/loader/impl/transformer/QuiltTransformer.java @@ -52,7 +52,7 @@ final class QuiltTransformer { int visitorCount = 0; if (strip) { - ClassStrippingData data = new ClassStrippingData(QuiltLoaderImpl.ASM_VERSION, envType, cache.getMods()); + ClassStrippingData data = new ClassStrippingData(QuiltLoaderImpl.ASM_VERSION, envType, cache.getAllMods()); classReader.accept(data, ClassReader.SKIP_CODE | ClassReader.SKIP_FRAMES); if (data.stripEntireClass()) { diff --git a/src/main/java/org/quiltmc/loader/impl/transformer/RuntimeModRemapper.java b/src/main/java/org/quiltmc/loader/impl/transformer/RuntimeModRemapper.java index 59d534dc2..189c1df2e 100644 --- a/src/main/java/org/quiltmc/loader/impl/transformer/RuntimeModRemapper.java +++ b/src/main/java/org/quiltmc/loader/impl/transformer/RuntimeModRemapper.java @@ -64,7 +64,7 @@ final class RuntimeModRemapper { static final boolean COPY_ON_WRITE = true; public static void remap(TransformCache cache) { - List modsToRemap = cache.getMods().stream() + List modsToRemap = cache.getModsInCache().stream() .filter(modLoadOption -> modLoadOption.namespaceMappingFrom() != null) .collect(Collectors.toList()); Set remapMixins = new HashSet<>(); diff --git a/src/main/java/org/quiltmc/loader/impl/transformer/TransformCache.java b/src/main/java/org/quiltmc/loader/impl/transformer/TransformCache.java index 937fb5a74..6ce093cd9 100644 --- a/src/main/java/org/quiltmc/loader/impl/transformer/TransformCache.java +++ b/src/main/java/org/quiltmc/loader/impl/transformer/TransformCache.java @@ -57,15 +57,17 @@ class TransformCache { private final Path root; private final Map modRoots = new HashMap<>(); - private final List orderedMods; + private final List allMods; + private final List modsInCache; private final Map hiddenClasses = new HashMap<>(); private static final boolean COPY_ON_WRITE = true; public TransformCache(Path root, List orderedMods) { this.root = root; - this.orderedMods = orderedMods.stream().filter(mod -> mod.needsTransforming() && !QuiltLoaderImpl.MOD_ID.equals(mod.id())).collect(Collectors.toList()); + this.allMods = orderedMods; + this.modsInCache = orderedMods.stream().filter(mod -> mod.needsTransforming() && !QuiltLoaderImpl.MOD_ID.equals(mod.id())).collect(Collectors.toList()); - for (ModLoadOption mod : this.orderedMods) { + for (ModLoadOption mod : this.modsInCache) { Path modSrc = mod.createTransformRoot(); Path modDst = root.resolve(mod.id()); modRoots.put(mod, modDst); @@ -152,7 +154,7 @@ public TransformCache(Path root, List orderedMods) { } // Populate mods that need remapped RuntimeModRemapper.remap(this); - for (ModLoadOption orderedMod : this.orderedMods) { + for (ModLoadOption orderedMod : this.modsInCache) { modRoots.put(orderedMod, root.resolve(orderedMod.id() + "/")); } } @@ -161,8 +163,14 @@ public Path getRoot(ModLoadOption mod) { return modRoots.get(mod); } - public List getMods() { - return Collections.unmodifiableList(orderedMods); + /** @return Every mod which has a {@link #getRoot(ModLoadOption)} in this cache. */ + public List getModsInCache() { + return Collections.unmodifiableList(modsInCache); + } + + /** @return The original list of mods, including any which aren't directly in this cache. */ + public List getAllMods() { + return Collections.unmodifiableList(allMods); } public Map getHiddenClasses() { @@ -171,7 +179,7 @@ public Map getHiddenClasses() { public void forEachClassFile(ClassConsumer action) throws IOException { - for (ModLoadOption mod : orderedMods) { + for (ModLoadOption mod : modsInCache) { visitFolder(mod, getRoot(mod), action); } } diff --git a/src/main/java/org/quiltmc/loader/impl/transformer/TransformCacheGenerator.java b/src/main/java/org/quiltmc/loader/impl/transformer/TransformCacheGenerator.java index a2148a094..d3d9e60ee 100644 --- a/src/main/java/org/quiltmc/loader/impl/transformer/TransformCacheGenerator.java +++ b/src/main/java/org/quiltmc/loader/impl/transformer/TransformCacheGenerator.java @@ -102,7 +102,7 @@ private static AccessWidener loadAccessWideners(TransformCache cache) { AccessWidener ret = new AccessWidener(); AccessWidenerReader accessWidenerReader = new AccessWidenerReader(ret); - for (ModLoadOption mod : cache.getMods()) { + for (ModLoadOption mod : cache.getModsInCache()) { for (String accessWidener : mod.metadata().accessWideners()) { Path path = cache.getRoot(mod).resolve(accessWidener);