13
0
geforkt von Mirrors/Paper

Add Plugin#getDataPath (#11080)

Dieser Commit ist enthalten in:
powercas_gamer 2024-07-15 14:07:17 +02:00
Ursprung 137019f867
Commit 5e9272f83c
3 geänderte Dateien mit 81 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -555,7 +555,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-public interface Plugin extends TabExecutor {
+public interface Plugin extends TabExecutor, io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner { // Paper
/**
* Returns the folder that the plugin data's files are located in. The
* Returns the folder that the plugin data files are located in. The
* folder may not yet exist.
@@ -0,0 +0,0 @@ public interface Plugin extends TabExecutor {
*/

Datei anzeigen

@ -1651,6 +1651,56 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*/
public interface OminousBottleMeta extends ItemMeta {
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 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Plugin extends TabExecutor {
/**
- * Returns the folder that the plugin data's files are located in. The
+ * Returns the folder that the plugin data files are located in. The
* folder may not yet exist.
*
* @return The folder
@@ -0,0 +0,0 @@ public interface Plugin extends TabExecutor {
public File getDataFolder();
/**
- * Returns the plugin.yaml file containing the details for this plugin
+ * Returns the plugin.yml file containing the details for this plugin
*
- * @return Contents of the plugin.yaml file
+ * @return Contents of the plugin.yml file
* @deprecated May be inaccurate due to different plugin implementations.
* @see Plugin#getPluginMeta()
*/
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase {
}
/**
- * Returns the folder that the plugin data's files are located in. The
+ * Returns the folder that the plugin data files are located in. The
* folder may not yet exist.
*
* @return The folder.
@@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase {
}
/**
- * Returns the plugin.yaml file containing the details for this plugin
+ * Returns the plugin.yml file containing the details for this plugin
*
- * @return Contents of the plugin.yaml file
+ * @return Contents of the plugin.yml file
* @deprecated No longer applicable to all types of plugins
*/
@NotNull
diff --git a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java b/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java

Datei anzeigen

@ -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
*