-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7baf427
commit 5d3a7ac
Showing
6 changed files
with
415 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Jake Potrebic <jake.m.potrebic@gmail.com> | ||
Date: Sat, 9 Jan 2021 22:21:41 -0800 | ||
Subject: [PATCH] Plugin Datapacks | ||
|
||
|
||
diff --git a/src/main/java/io/papermc/paper/plugin/DatapackConfiguration.java b/src/main/java/io/papermc/paper/plugin/DatapackConfiguration.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..9e48ad4f2bd9d73fdaf1e05b5338e4a54d5cd146 | ||
--- /dev/null | ||
+++ b/src/main/java/io/papermc/paper/plugin/DatapackConfiguration.java | ||
@@ -0,0 +1,22 @@ | ||
+package io.papermc.paper.plugin; | ||
+ | ||
+import net.kyori.adventure.text.Component; | ||
+import org.jetbrains.annotations.NotNull; | ||
+import org.jetbrains.annotations.Nullable; | ||
+ | ||
+public interface DatapackConfiguration { | ||
+ | ||
+ /** | ||
+ * Gets the directory inside the plugin's file for the datapack. | ||
+ * | ||
+ * @return the datapack directory | ||
+ */ | ||
+ @NotNull String directory(); | ||
+ | ||
+ /** | ||
+ * Gets the datapack's configured name. | ||
+ * | ||
+ * @return the name or null if none configured | ||
+ */ | ||
+ @Nullable Component name(); | ||
+} | ||
diff --git a/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java b/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java | ||
index ef393f1f93ca48264fc1b6e3a27787f6a9152e1b..c0037d779cbfe926221559598fc9965717202768 100644 | ||
--- a/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java | ||
+++ b/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java | ||
@@ -1,5 +1,6 @@ | ||
package io.papermc.paper.plugin.configuration; | ||
|
||
+import io.papermc.paper.plugin.DatapackConfiguration; | ||
import org.bukkit.permissions.Permission; | ||
import org.bukkit.permissions.PermissionDefault; | ||
import org.bukkit.plugin.PluginLoadOrder; | ||
@@ -200,4 +201,11 @@ public interface PluginMeta { | ||
@Nullable | ||
String getAPIVersion(); | ||
|
||
+ /** | ||
+ * Get the configuration for the datapack associated with the plugin. | ||
+ * | ||
+ * @return the datapack configuration (or null if none) | ||
+ */ | ||
+ @Nullable DatapackConfiguration getDatapackConfiguration(); | ||
+ | ||
} | ||
diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java | ||
index f1ae66989afaa433bf2896e0bfe2cea472f774d8..4eb40bbbc2740c1fa25adad9d56c1afe634687f1 100644 | ||
--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java | ||
+++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java | ||
@@ -317,6 +317,11 @@ public final class PluginDescriptionFile implements io.papermc.paper.plugin.conf | ||
public @NotNull List<String> getProvidedPlugins() { | ||
return this.provides; | ||
} | ||
+ | ||
+ @Override | ||
+ public @Nullable io.papermc.paper.plugin.DatapackConfiguration getDatapackConfiguration() { | ||
+ return null; | ||
+ } | ||
// Paper end | ||
|
||
public PluginDescriptionFile(@NotNull final InputStream stream) throws InvalidDescriptionException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.