Add Plugin#getDataPath (#11080)

Dieser Commit ist enthalten in:
powercas_gamer 2024-07-15 14:07:17 +02:00 committet von GitHub
Ursprung 8b35adca88
Commit b4f04ff4b3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
3 geänderte Dateien mit 83 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -1651,6 +1651,56 @@ index 43f0df04f3cdff7d7db73321a2886f3a737e3c9f..5c741228b2338a7c4de2fe736eb78951
*/
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 8c76716249e44ed8bf6be94c1f5c7b6d9bb35be2..68a0ed5f0ed25e98f4ab4d1e482ec2ccfda9cd3a 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -18,7 +18,7 @@ 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
@@ -27,9 +27,9 @@ 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 2a14522c484febcd880d00197df4359a0020dddd..7f17337b9f0fb60fa1c91c47af496c03290d1b1c 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -69,7 +69,7 @@ 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.
@@ -127,9 +127,9 @@ 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 b84b37fe27d84574dc5897285f1d9a1437bd322c..281ae60a6be7e39aab4f27b4c7de3d49ada9a557 100644
--- a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java

Datei anzeigen

@ -545,7 +545,7 @@ index 1887cc2882ea197481b39693cc48aa16ccde5782..c8c966feade4881f7a741ce059803f08
+ // Paper end - lifecycle event API
}
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 4eb639fbb46a0848be207149ea433455550fae1c..ef431219fd2bce48bad63b6b92c99d54348d480e 100644
index 46fc37a36403c8fbc4c0c9f863d4d57eb3896bd4..0ff8b53f900092dc419d61a8ede0a7cd72a2e1e1 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.Nullable;
@ -555,7 +555,7 @@ index 4eb639fbb46a0848be207149ea433455550fae1c..ef431219fd2bce48bad63b6b92c99d54
-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.
@@ -224,4 +224,14 @@ public interface Plugin extends TabExecutor {
*/
@ -573,7 +573,7 @@ index 4eb639fbb46a0848be207149ea433455550fae1c..ef431219fd2bce48bad63b6b92c99d54
+ // Paper end - lifecycle events
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
index d359ea9b02952f981b9cf9d778c56eb995454c60..d5a3c3dce76c4ed0f1184ab5ba21db9c5f1c01ec 100644
index 2d64fc065d53dcd8c01d05215c3e63aaf4428177..e0203f199700c397961a0667a79792497da7f796 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -48,6 +48,11 @@ public abstract class JavaPlugin extends PluginBase {

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 0ff8b53f900092dc419d61a8ede0a7cd72a2e1e1..29ce61fce75606fbcc63b798fc8f13d3eafd2b74 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/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
*