update mapping-io, fix #473 (#474)

This commit is contained in:
Logic 2021-08-22 10:03:09 -04:00 committed by GitHub
parent 97a629eef9
commit 9a470a49d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View file

@ -81,7 +81,7 @@ dependencies {
implementation ('net.fabricmc:tiny-mappings-parser:0.3.0+build.17')
implementation 'net.fabricmc:access-widener:1.1.0'
implementation 'net.fabricmc:mapping-io:0.1.3'
implementation 'net.fabricmc:mapping-io:0.2.0'
implementation ('net.fabricmc:lorenz-tiny:3.0.0') {
transitive = false

View file

@ -76,7 +76,7 @@ public class LayeredMappingsDependency implements SelfResolvingDependency {
Tiny2Writer tiny2Writer = new Tiny2Writer(writer, false);
MappingDstNsReorder nsReorder = new MappingDstNsReorder(tiny2Writer, Collections.singletonList(MappingNamespace.NAMED.stringValue()));
MappingSourceNsSwitch nsSwitch = new MappingSourceNsSwitch(nsReorder, MappingNamespace.INTERMEDIARY.stringValue());
MappingSourceNsSwitch nsSwitch = new MappingSourceNsSwitch(nsReorder, MappingNamespace.INTERMEDIARY.stringValue(), true);
mappings.accept(nsSwitch);
Files.deleteIfExists(mappingsFile);

View file

@ -24,6 +24,7 @@
package net.fabricmc.loom.configuration.providers.mappings.parchment;
import java.io.IOException;
import java.util.Locale;
import net.fabricmc.mappingio.MappingVisitor;
@ -35,7 +36,7 @@ public final class ParchmentPrefixStripingMappingVisitor extends ForwardingMappi
}
@Override
public boolean visitMethodArg(int argPosition, int lvIndex, String srcName) {
public boolean visitMethodArg(int argPosition, int lvIndex, String srcName) throws IOException {
return super.visitMethodArg(argPosition, lvIndex, stripMethodArg(srcName));
}

View file

@ -24,6 +24,7 @@
package net.fabricmc.loom.configuration.providers.mappings.parchment;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
@ -39,7 +40,7 @@ public record ParchmentTreeV1(
@Nullable
List<Package> packages
) {
public void visit(MappingVisitor visitor, String srcNamespace) {
public void visit(MappingVisitor visitor, String srcNamespace) throws IOException {
while (true) {
if (visitor.visitHeader()) {
visitor.visitNamespaces(srcNamespace, Collections.emptyList());
@ -68,7 +69,7 @@ public record ParchmentTreeV1(
@Nullable
List<String> javadoc
) {
public void visit(MappingVisitor visitor) {
public void visit(MappingVisitor visitor) throws IOException {
if (visitor.visitClass(name())) {
if (!visitor.visitElementContent(MappedElementKind.CLASS)) {
return;
@ -99,7 +100,7 @@ public record ParchmentTreeV1(
@Nullable
List<String> javadoc
) {
public void visit(MappingVisitor visitor) {
public void visit(MappingVisitor visitor) throws IOException {
if (visitor.visitField(name, descriptor)) {
if (!visitor.visitElementContent(MappedElementKind.FIELD)) {
return;
@ -120,7 +121,7 @@ public record ParchmentTreeV1(
@Nullable
List<String> javadoc
) {
public void visit(MappingVisitor visitor) {
public void visit(MappingVisitor visitor) throws IOException {
if (visitor.visitMethod(name, descriptor)) {
if (!visitor.visitElementContent(MappedElementKind.METHOD)) {
return;
@ -145,7 +146,7 @@ public record ParchmentTreeV1(
@Nullable
String javadoc
) {
public void visit(MappingVisitor visitor) {
public void visit(MappingVisitor visitor) throws IOException {
if (visitor.visitMethodArg(index, index, name)) {
if (!visitor.visitElementContent(MappedElementKind.METHOD_ARG)) {
return;