Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable same-name proposal on non hashed mappings #629

Merged
merged 3 commits into from
Aug 20, 2024
Merged
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 @@ -32,7 +32,6 @@ public void run() {
final Multimap<String, File> allMappings = HashMultimap.create();
final Set<String> duplicateMappings = new HashSet<>();
final List<File> emptyFiles = new ArrayList<>();
final List<File> mapNoClassFiles = new ArrayList<>();
final List<File> wrongExtensionFiles = new ArrayList<>();

try (Stream<Path> mappingPaths = Files.walk(getMappingDirectory().get().getAsFile().toPath())) {
Expand All @@ -42,15 +41,14 @@ public void run() {
try (var reader = new BufferedReader(new FileReader(mappingFile))) {
final String firstLine = reader.readLine();
if (firstLine != null) {
getClassMatch(firstLine).ifPresentOrElse(
getClassMatch(firstLine).ifPresent(
classMatch -> {
final Collection<File> classMappings = allMappings.get(classMatch);

if (!classMappings.isEmpty()) duplicateMappings.add(classMatch);

classMappings.add(mappingFile);
},
() -> mapNoClassFiles.add(mappingFile)
}
);
} else {
emptyFiles.add(mappingFile);
Expand Down Expand Up @@ -98,19 +96,6 @@ public void run() {
}
}

if (!mapNoClassFiles.isEmpty()) {
final String message = "%d file%s not mapping a class".formatted(
mapNoClassFiles.size(),
mapNoClassFiles.size() == 1 ? "" : "s"
);
errorMessages.add(message);

LOGGER.error("Found {}!", message);
for (final File mapNoClassFile : mapNoClassFiles) {
LOGGER.error("\t{}", mapNoClassFile);
}
}

if (!wrongExtensionFiles.isEmpty()) {
final String message = "%d file%s without the mapping extension".formatted(
wrongExtensionFiles.size(),
Expand Down
5 changes: 4 additions & 1 deletion enigma_profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"id": "enigma:specialized_method_name_proposer"
},
{
"id": "quiltmc:name_proposal"
"id": "quiltmc:name_proposal",
"args": {
"disable_map_non_hashed": "false"
}
}
],
"jar_indexer": {
Expand Down
Loading
Loading