Paper/Spigot-API-Patches/0118-Add-an-asterisk-to-legacy-API-plugins.patch
Aikar c0d07c1b67
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
f009c3dd SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
e677c370 Update ECJ version
5058a35d SPIGOT-5860: Item.setItemStack should be NotNull

CraftBukkit Changes:
d77f4d9b SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
53c95627 SPIGOT-5865: Piglin does not trigger EntityPickupItemEvent
2ab04d24 Update ECJ version
7884e079 SPIGOT-5868: Blocks do not tick in custom nether / end
2a848286 SPIGOT-5863: Don't check colour in scoreboard length validation
f2cbce30 SPIGOT-5866: Beehive unknown TargetReason

Spigot Changes:
ad703da0 SPIGOT-5870: /plugins "website" field shows "version"
1a27cfd8 #98: Improve output of /plugins command using text components
732d5bab Disable checkstyle in Spigot blocks
0199a9a6 #97: Add Memory Usage to Ticks Per Second Command.
33ea98fc SPIGOT-5858: NPE: Joining the server with an invalid dimension
2020-06-27 21:54:05 -04:00

64 lines
3.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 19 Jul 2018 22:07:02 +0200
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
index 1b6d737046646c102b0d519ab3f67c3fbd503979..541e28a9bece0beb0c2cf02c39030840b758c6e6 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -84,5 +84,11 @@ public interface UnsafeValues {
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
}
+
+ boolean isSupportedApiVersion(String apiVersion);
+
+ static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
+ return !Bukkit.getUnsafe().isSupportedApiVersion(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
index 6b21089cd4a09c3c49caf19f1b70f7a50dba3995..ae07c88937da014d711e219b07e7d4b767f24ba5 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -74,7 +74,13 @@ public class PluginsCommand extends BukkitCommand {
pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
- pluginList.append(plugin.getDescription().getName());
+ // Paper start - Add an asterisk to legacy plugins (so admins are aware)
+ String pluginName = plugin.getDescription().getName();
+ if (org.bukkit.UnsafeValues.isLegacyPlugin(plugin)) {
+ pluginName += "*";
+ }
+ pluginList.append(pluginName);
+ // Paper end
}
return "(" + plugins.size() + "): " + pluginList.toString();
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index bef88a6e2e6f7071401a3af0aec31e62aa265566..de44d850d7b3ab3e528eb6f2de375a6c3e0e5cf9 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -315,7 +315,14 @@ public final class JavaPluginLoader implements PluginLoader {
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;