Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ final class RuntimeModRemapper {

throw new UnsupportedOperationException("Cannot remap mojang mods to another environment!");
}
if (namespace != null) {
if (namespace != null && !namespace.equals(mappingConfiguration.getTargetNamespace())) {
modsToRemap.add(mod);
}
}
}

public boolean doesModNeedRemapping(ModLoadOption mod) {
return modsToRemap.contains(mod);
public boolean modNeedsRemapping(ModLoadOption mod) {
return mod.namespaceMappingFrom() != null && !mod.namespaceMappingFrom().equals(QuiltLauncherBase.getLauncher().getMappingConfiguration().getTargetNamespace());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this check duplicated? Surely we only need to check this once - that way we can rely on the list being correct everywhere that it's iterated.

}

public void remap(TransformCache cache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ public TransformCache(Path root, List<ModLoadOption> orderedMods) {
}

// copy classes for mods which don't need remapped
if (!remapper.doesModNeedRemapping(mod)) {
if (!remapper.modNeedsRemapping(mod)) {
try (Stream<Path> stream = Files.walk(modSrc)) {
stream
.filter(FasterFiles::isRegularFile)
.filter(p -> p.getFileName().toString().endsWith(".class") || p.getFileName().toString().endsWith(".chasm"))
.forEach(path -> copyFile(path, modSrc, modDst));
}
}
} else if (remapper.doesModNeedRemapping(mod)) {
} else if (remapper.modNeedsRemapping(mod)) {
// Copy everything that isn't a class file, since those get remapped
try (Stream<Path> stream = Files.walk(modSrc)) {
stream
Expand Down