2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-12-01 14:06:14 +00:00
|
|
|
From: Phoenix616 <max@themoep.de>
|
|
|
|
Date: Tue, 1 Dec 2020 14:57:02 +0100
|
2018-07-19 20:08:07 +00:00
|
|
|
Subject: [PATCH] Add an asterisk to legacy API plugins
|
|
|
|
|
|
|
|
Not here to name and shame, only so server admins can be aware of which
|
|
|
|
plugins have and haven't been updated.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
2021-04-22 12:48:49 +00:00
|
|
|
index 195b6bb328de92c4d17d1cd14e13578226b1ac3c..d6897f43a0692e031bed8a212d9a637ef548cc60 100644
|
2018-07-19 20:08:07 +00:00
|
|
|
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
2021-04-22 12:48:49 +00:00
|
|
|
@@ -91,5 +91,11 @@ public interface UnsafeValues {
|
2019-05-27 09:13:41 +00:00
|
|
|
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
|
|
|
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
|
|
|
|
}
|
2018-07-19 20:08:07 +00:00
|
|
|
+
|
2019-12-15 18:28:44 +00:00
|
|
|
+ boolean isSupportedApiVersion(String apiVersion);
|
|
|
|
+
|
2018-07-19 20:08:07 +00:00
|
|
|
+ static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
|
2019-12-15 18:28:44 +00:00
|
|
|
+ return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
|
2018-07-19 20:08:07 +00:00
|
|
|
+ }
|
2019-05-06 07:20:16 +00:00
|
|
|
// Paper end
|
2018-07-19 20:08:07 +00:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
2020-12-01 14:06:14 +00:00
|
|
|
index 4de959bbd1270d7d6ea8e5e69521bcca6abe2138..1aa58c59e1e8738bbdc77752885ff3b18b29de42 100644
|
2018-07-19 20:08:07 +00:00
|
|
|
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
2020-12-01 14:06:14 +00:00
|
|
|
@@ -52,9 +52,15 @@ public class PluginsCommand extends BukkitCommand {
|
|
|
|
}
|
2020-03-26 02:37:20 +00:00
|
|
|
|
2020-12-01 14:06:14 +00:00
|
|
|
Plugin plugin = entry.getValue();
|
|
|
|
-
|
|
|
|
+
|
2020-03-26 02:37:20 +00:00
|
|
|
pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
|
|
|
|
- pluginList.append(plugin.getDescription().getName());
|
2018-07-19 20:08:07 +00:00
|
|
|
+ // Paper start - Add an asterisk to legacy plugins (so admins are aware)
|
|
|
|
+ String pluginName = plugin.getDescription().getName();
|
|
|
|
+ if (org.bukkit.UnsafeValues.isLegacyPlugin(plugin)) {
|
|
|
|
+ pluginName += "*";
|
|
|
|
+ }
|
2020-03-26 02:37:20 +00:00
|
|
|
+ pluginList.append(pluginName);
|
2018-07-19 20:08:07 +00:00
|
|
|
+ // Paper end
|
|
|
|
|
2020-12-01 14:06:14 +00:00
|
|
|
if (plugin.getDescription().getProvides().size() > 0) {
|
|
|
|
pluginList.append(" (").append(String.join(", ", plugin.getDescription().getProvides())).append(")");
|
2018-07-19 20:08:07 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
2020-06-25 01:10:30 +00:00
|
|
|
index bef88a6e2e6f7071401a3af0aec31e62aa265566..de44d850d7b3ab3e528eb6f2de375a6c3e0e5cf9 100644
|
2018-07-19 20:08:07 +00:00
|
|
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
|
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
2020-01-28 19:43:57 +00:00
|
|
|
@@ -315,7 +315,14 @@ public final class JavaPluginLoader implements PluginLoader {
|
2018-07-19 20:08:07 +00:00
|
|
|
Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader");
|
|
|
|
|
|
|
|
if (!plugin.isEnabled()) {
|
|
|
|
- plugin.getLogger().info("Enabling " + plugin.getDescription().getFullName());
|
|
|
|
+ // Paper start - Add an asterisk to legacy plugins (so admins are aware)
|
|
|
|
+ String enableMsg = "Enabling " + plugin.getDescription().getFullName();
|
|
|
|
+ if (org.bukkit.UnsafeValues.isLegacyPlugin(plugin)) {
|
|
|
|
+ enableMsg += "*";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ plugin.getLogger().info(enableMsg);
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
JavaPlugin jPlugin = (JavaPlugin) plugin;
|
|
|
|
|