2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-07-19 22:08:07 +02:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
2019-12-15 19:28:44 +01:00
|
|
|
Date: Thu, 19 Jul 2018 22:07:02 +0200
|
2018-07-19 22:08:07 +02: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
|
2020-06-25 03:10:30 +02:00
|
|
|
index 1b6d737046646c102b0d519ab3f67c3fbd503979..541e28a9bece0beb0c2cf02c39030840b758c6e6 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
|
2020-06-03 05:26:29 +02:00
|
|
|
@@ -84,5 +84,11 @@ public interface UnsafeValues {
|
2019-05-27 11:13:41 +02:00
|
|
|
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
|
|
|
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
|
|
|
|
}
|
2018-07-19 22:08:07 +02:00
|
|
|
+
|
2019-12-15 19:28:44 +01:00
|
|
|
+ boolean isSupportedApiVersion(String apiVersion);
|
|
|
|
+
|
2018-07-19 22:08:07 +02:00
|
|
|
+ static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
|
2019-12-15 19:28:44 +01:00
|
|
|
+ return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
|
2018-07-19 22:08:07 +02:00
|
|
|
+ }
|
2019-05-06 09:20:16 +02:00
|
|
|
// Paper end
|
2018-07-19 22:08:07 +02:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
|
2020-07-23 01:35:44 +02:00
|
|
|
index ba399ee5ab33b4fd8741bce53509a17b1aabc84d..cbcdca042b54531fdf45e8631c4bbe8c74f68341 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
|
2020-06-28 03:54:05 +02:00
|
|
|
@@ -74,7 +74,13 @@ public class PluginsCommand extends BukkitCommand {
|
2018-07-19 22:08:07 +02:00
|
|
|
|
2020-03-26 03:37:20 +01:00
|
|
|
|
|
|
|
pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
|
|
|
|
- pluginList.append(plugin.getDescription().getName());
|
2018-07-19 22:08:07 +02: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 03:37:20 +01:00
|
|
|
+ pluginList.append(pluginName);
|
2018-07-19 22:08:07 +02:00
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
2020-03-26 03:37:20 +01:00
|
|
|
return "(" + plugins.size() + "): " + pluginList.toString();
|
2018-07-19 22:08:07 +02: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 03:10:30 +02:00
|
|
|
index bef88a6e2e6f7071401a3af0aec31e62aa265566..de44d850d7b3ab3e528eb6f2de375a6c3e0e5cf9 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
|
2020-01-28 20:43:57 +01:00
|
|
|
@@ -315,7 +315,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;
|
|
|
|
|