Add Plugin#getDataPath (#11080)

This commit is contained in:
powercas_gamer
2024-07-15 14:07:17 +02:00
parent 137019f867
commit 5e9272f83c
3 changed files with 81 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: powercas_gamer <cas@mizule.dev>
Date: Mon, 15 Jul 2024 02:07:49 +0000
Subject: [PATCH] add Plugin#getDataPath
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -0,0 +0,0 @@ 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
*