Skip to content

Commit

Permalink
Fix TransformForgeEnvironment using hardcoded srg mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jab125 committed Jul 13, 2024
1 parent 2c4ae6d commit 252e4e2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private IMappingProvider remapEnvironment() {
}

private List<IMappingProvider> mapMixin() throws IOException {
String productionNamespace = System.getProperty(BuiltinProperties.FORGE_PRODUCTION_NAMESPACE, "srg");
List<IMappingProvider> providers = new ArrayList<>();

if (srg == null) {
Expand All @@ -86,7 +87,7 @@ public void acceptClass(String srcName, String dstName) {
.stream()
.filter(it -> Objects.equals(it.getName("intermediary"), dstName))
.findFirst()
.map(it -> it.getName("srg"))
.map(it -> it.getName(productionNamespace))
.orElse(dstName);
sink.acceptClass(srcName, srgName);
Logger.debug("Remap mixin class %s -> %s", srcName, srgName);
Expand All @@ -99,7 +100,7 @@ public void acceptMethod(IMappingProvider.Member method, String dstName) {
.flatMap(it -> it.getMethods().stream())
.filter(it -> Objects.equals(it.getName("intermediary"), dstName))
.findFirst()
.map(it -> it.getName("srg"))
.map(it -> it.getName(productionNamespace))
.orElse(dstName);
sink.acceptMethod(method, srgName);
Logger.debug("Remap mixin method %s#%s%s -> %s", method.owner, method.name, method.desc, srgName);
Expand All @@ -112,7 +113,7 @@ public void acceptField(IMappingProvider.Member field, String dstName) {
.flatMap(it -> it.getFields().stream())
.filter(it -> Objects.equals(it.getName("intermediary"), dstName))
.findFirst()
.map(it -> it.getName("srg"))
.map(it -> it.getName(productionNamespace))
.orElse(dstName);
sink.acceptField(field, srgName);
Logger.debug("Remap mixin field %s#%s:%s -> %s", field.owner, field.name, field.desc, srgName);
Expand Down

0 comments on commit 252e4e2

Please sign in to comment.