From a0145bb862f448a07bffcb16709aae9a0d9c8948 Mon Sep 17 00:00:00 2001
From: XiaoPangxie732 <47449269+XiaoPangxie732@users.noreply.github.com>
Date: Sun, 25 Aug 2024 22:09:04 +0800
Subject: [PATCH] Make MCD API optional for Parchment extension
---
extensions/parchment/pom.xml | 6 ++++++
.../mcdecompiler/mapping/parchment/ParchmentExtension.java | 4 +---
.../mapping/parchment/ParchmentMappingFormat.java | 3 ++-
.../test/mapping/parchment/ParchmentFormatTest.java | 3 +--
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/extensions/parchment/pom.xml b/extensions/parchment/pom.xml
index c3b7c92..4440d0e 100644
--- a/extensions/parchment/pom.xml
+++ b/extensions/parchment/pom.xml
@@ -17,6 +17,12 @@
cn.maxpixel.minecraft-decompiler
api
${project.version}
+ provided
+
+
+ cn.maxpixel.minecraft-decompiler
+ mapping-api
+ ${project.version}
org.jetbrains
diff --git a/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentExtension.java b/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentExtension.java
index 8b8d950..dfd8b1b 100644
--- a/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentExtension.java
+++ b/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentExtension.java
@@ -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
diff --git a/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentMappingFormat.java b/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentMappingFormat.java
index e3d438a..4f859d3 100644
--- a/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentMappingFormat.java
+++ b/extensions/parchment/src/main/java/cn/maxpixel/mcdecompiler/mapping/parchment/ParchmentMappingFormat.java
@@ -10,6 +10,7 @@
public enum ParchmentMappingFormat implements MappingFormat.Classified {
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";
@@ -23,7 +24,7 @@ public enum ParchmentMappingFormat implements MappingFormat.Classified