-
-
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
ef2b574
commit f0d2664
Showing
7 changed files
with
395 additions
and
21 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
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 07e8908d25fcd4e5eabadc9f019b54acff3b5e3c..3262604179abd4899d474c1a48d6a4871155a393 100644 | ||
--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java | ||
+++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java | ||
@@ -321,6 +321,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.