2019-02-23 18:17:41 +01:00
|
|
|
From 6230eaa152107e64e9b93acba461412d68f368a6 Mon Sep 17 00:00:00 2001
|
2018-07-19 22:08:07 +02:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
|
|
Date: Thu, 19 Jul 2018 15:07:02 -0500
|
|
|
|
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-01-01 04:15:55 +01:00
|
|
|
index a4aabfe7..f462b631 100644
|
2018-07-19 22:08:07 +02:00
|
|
|
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
2018-08-27 05:05:00 +02:00
|
|
|
@@ -67,4 +67,10 @@ public interface UnsafeValues {
|
2018-07-19 22:08:07 +02:00
|
|
|
* @return true if a file matching this key was found and deleted
|
|
|
|
*/
|
|
|
|
boolean removeAdvancement(NamespacedKey key);
|
|
|
|
+
|
|
|
|
+ // Paper start - Add legacy check util
|
|
|
|
+ static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
|
|
|
|
+ return !("1.13".equals(plugin.getDescription().getAPIVersion()));
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
2019-01-01 04:15:55 +01:00
|
|
|
index b1d384e8..72c0c0bc 100644
|
2018-07-19 22:08:07 +02:00
|
|
|
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
|
|
|
@@ -38,7 +38,14 @@ public class PluginsCommand extends BukkitCommand {
|
|
|
|
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-01-01 04:15:55 +01:00
|
|
|
index c7782e7d..39f92d88 100644
|
2018-07-19 22:08:07 +02:00
|
|
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
|
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -304,7 +304,14 @@ public final class JavaPluginLoader implements PluginLoader {
|
2018-07-19 22:08:07 +02: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;
|
|
|
|
|
|
|
|
--
|
2019-01-01 04:15:55 +01:00
|
|
|
2.20.1
|
2018-07-19 22:08:07 +02:00
|
|
|
|