mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Avoid Mapping-IO limitations on modifying a mapping tree with active visitor. (#278)
- Use Mapping-IO API when modifying its tree - Close mapping visitor before modifying mapping tree - Seems to avoid #276
This commit is contained in:
@@ -175,6 +175,7 @@ public final class ForgeMappingsMerger {
|
||||
}
|
||||
}
|
||||
|
||||
flatOutput.visitEnd();
|
||||
resolveConflicts();
|
||||
|
||||
return output;
|
||||
@@ -317,8 +318,14 @@ public final class ForgeMappingsMerger {
|
||||
// Remove non-preferred methods
|
||||
for (MethodData method : methods) {
|
||||
if (method != preferred) {
|
||||
MappingTree.ClassMapping clazz = output.getClass(method.obfOwner());
|
||||
clazz.getMethods().removeIf(m -> m.getSrcName().equals(method.obfName()) && m.getSrcDesc().equals(method.obfDesc()));
|
||||
MappingTree.ClassMapping classMapping = output.getClass(method.obfOwner());
|
||||
|
||||
// TODO: Change if/when MIO supports removals again
|
||||
for (MappingTree.MethodMapping methodMapping : List.copyOf(classMapping.getMethods())) {
|
||||
if (methodMapping.getSrcName().equals(method.obfName()) && methodMapping.getSrcDesc().equals(method.obfDesc())) {
|
||||
classMapping.removeMethod(methodMapping.getSrcName(), methodMapping.getSrcDesc());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user