diff --git a/build.gradle b/build.gradle index 6f989e2..6f79a75 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,7 @@ dependencies { } // tinyfile management - implementation ('net.fabricmc:tiny-remapper:0.5.0') + implementation ('net.fabricmc:tiny-remapper:0.6.0') implementation 'net.fabricmc:access-widener:2.0.0' implementation 'net.fabricmc:mapping-io:0.2.1' diff --git a/src/main/java/net/fabricmc/loom/util/TinyRemapperHelper.java b/src/main/java/net/fabricmc/loom/util/TinyRemapperHelper.java index aa295f0..77f710d 100644 --- a/src/main/java/net/fabricmc/loom/util/TinyRemapperHelper.java +++ b/src/main/java/net/fabricmc/loom/util/TinyRemapperHelper.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.Map; +import java.util.regex.Pattern; import com.google.common.collect.ImmutableMap; import org.gradle.api.Project; @@ -47,6 +48,11 @@ public final class TinyRemapperHelper { .put("javax/annotation/concurrent/Immutable", "org/jetbrains/annotations/Unmodifiable") .build(); + /** + * Matches the new local variable naming format introduced in 21w37a. + */ + private static final Pattern MC_LV_PATTERN = Pattern.compile("\\$\\$\\d+"); + private TinyRemapperHelper() { } @@ -58,6 +64,7 @@ public final class TinyRemapperHelper { .withMappings(out -> JSR_TO_JETBRAINS.forEach(out::acceptClass)) .renameInvalidLocals(true) .rebuildSourceFilenames(true) + .invalidLvNamePattern(MC_LV_PATTERN) .build(); }