From e8e8c4f7c231d6672ac556b09d5d2636d1482e3b Mon Sep 17 00:00:00 2001 From: powercas_gamer Date: Mon, 15 Jul 2024 02:07:49 +0000 Subject: [PATCH] add Plugin#getDataPath --- .../src/main/java/org/bukkit/plugin/Plugin.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/plugin/Plugin.java b/paper-api/src/main/java/org/bukkit/plugin/Plugin.java index 0ff8b53f9..29ce61fce 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/Plugin.java +++ b/paper-api/src/main/java/org/bukkit/plugin/Plugin.java @@ -26,6 +26,19 @@ public interface Plugin extends TabExecutor, io.papermc.paper.plugin.lifecycle.e @NotNull public File getDataFolder(); + // Paper start - add getDataPath() + /** + * Returns the path that the plugin data files are located in. + * The folder may not yet exist. + * + * @see #getDataFolder() + * @return The folder + */ + default @NotNull java.nio.file.Path getDataPath() { + return getDataFolder().toPath(); + } + // Paper end - add getDataPath() + /** * Returns the plugin.yml file containing the details for this plugin *