Skip to content

Commit

Permalink
Make MCD API optional for Parchment extension
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoPangxie732 committed Aug 25, 2024
1 parent 3aefb43 commit a0145bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions extensions/parchment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<groupId>cn.maxpixel.minecraft-decompiler</groupId>
<artifactId>api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cn.maxpixel.minecraft-decompiler</groupId>
<artifactId>mapping-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
import org.jetbrains.annotations.NotNull;

public class ParchmentExtension implements Extension {
public static final String NAME = "parchment";

@NotNull
@Override
public String getName() {
return NAME;
return ParchmentMappingFormat.NAME;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

public enum ParchmentMappingFormat implements MappingFormat.Classified<PairedMapping> {
INSTANCE;
public static final String NAME = "parchment";
public static final String KEY_NAME = "name";
public static final String KEY_JAVADOC = "javadoc";
public static final String KEY_DESCRIPTOR = "descriptor";
Expand All @@ -23,7 +24,7 @@ public enum ParchmentMappingFormat implements MappingFormat.Classified<PairedMap

@Override
public @NotNull String getName() {
return ParchmentExtension.NAME;
return NAME;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import cn.maxpixel.mcdecompiler.common.util.Utils;
import cn.maxpixel.mcdecompiler.mapping.format.MappingFormats;
import cn.maxpixel.mcdecompiler.mapping.parchment.FormatVersion;
import cn.maxpixel.mcdecompiler.mapping.parchment.ParchmentExtension;
import cn.maxpixel.mcdecompiler.mapping.parchment.ParchmentMappingFormat;
import cn.maxpixel.mcdecompiler.mapping.parchment.ParchmentMappingProcessor;
import cn.maxpixel.rewh.logging.LogManager;
Expand Down Expand Up @@ -33,7 +32,7 @@ void testFormatVersion() {
@Test
void testFormatExtension() {
ExtensionManager.init();
assertEquals(ParchmentMappingFormat.INSTANCE, MappingFormats.get(ParchmentExtension.NAME));
assertEquals(ParchmentMappingFormat.INSTANCE, MappingFormats.get(ParchmentMappingFormat.NAME));
}

@Test
Expand Down

0 comments on commit a0145bb

Please sign in to comment.