2020-01-22 02:02:07 +00:00
|
|
|
From 813ce8218fdf13b0b06e2524ce7fb885b1d2de28 Mon Sep 17 00:00:00 2001
|
2018-07-19 20:08:07 +00:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
2019-12-15 18:28:44 +00:00
|
|
|
Date: Thu, 19 Jul 2018 22:07:02 +0200
|
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
|
2019-12-15 18:28:44 +00:00
|
|
|
index c0ff133d..82106426 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
|
2019-12-15 18:28:44 +00:00
|
|
|
@@ -83,5 +83,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
|
2019-12-15 18:28:44 +00:00
|
|
|
index d4e74d29..6cfd9f3c 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
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -41,7 +41,14 @@ public class PluginsCommand extends BukkitCommand {
|
2018-07-19 20:08:07 +00:00
|
|
|
TreeMap<String, ChatColor> plugins = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
|
|
|
|
|
|
|
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
|
|
|
- plugins.put(plugin.getDescription().getName(), plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
|
|
|
|
+ // Paper start - Add an asterisk to legacy plugins (so admins are aware)
|
|
|
|
+ String pluginName = plugin.getDescription().getName();
|
|
|
|
+ if (org.bukkit.UnsafeValues.isLegacyPlugin(plugin)) {
|
|
|
|
+ pluginName += "*";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ plugins.put(pluginName, plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
StringBuilder pluginList = new StringBuilder();
|
|
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
2019-12-15 18:28:44 +00:00
|
|
|
index bc7bf6a3..31a70b29 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
|
2019-05-06 02:58:04 +00:00
|
|
|
@@ -316,7 +316,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;
|
|
|
|
|
|
|
|
--
|
2020-01-22 02:02:07 +00:00
|
|
|
2.25.0.windows.1
|
2018-07-19 20:08:07 +00:00
|
|
|
|