From b8994aff614fba016ad80c3e8377dc4028ad7f33 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 2 Feb 2013 16:41:52 +1100 Subject: [PATCH] Abuse plugins which embed metrics in the default location. --- .../0004-Add-nag-for-bad-plugins.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Bukkit-Patches/0004-Add-nag-for-bad-plugins.patch diff --git a/Bukkit-Patches/0004-Add-nag-for-bad-plugins.patch b/Bukkit-Patches/0004-Add-nag-for-bad-plugins.patch new file mode 100644 index 0000000000..b3b7734661 --- /dev/null +++ b/Bukkit-Patches/0004-Add-nag-for-bad-plugins.patch @@ -0,0 +1,30 @@ +From 88434c8203dffc0461bf7a73a45af6c6e1052d5d Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Sat, 2 Feb 2013 16:40:42 +1100 +Subject: [PATCH] Add nag for bad plugins. + +--- + src/main/java/org/bukkit/plugin/java/PluginClassLoader.java | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +index 29ec3fc..da3ab0b 100644 +--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +@@ -69,6 +69,13 @@ public class PluginClassLoader extends URLClassLoader { + if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) { + throw new ClassNotFoundException(name); + } ++ ++ // Spigot start ++ if (name.equals("org.mcstats.Metrics")) { ++ loader.server.getLogger().warning("Plugin from file: " + getURLs()[0] + " has embedded Metrics in the default package. This is not advisable, go nag them!"); ++ } ++ // Spigot end ++ + Class result = classes.get(name); + + if (result == null) { +-- +1.8.1-rc2 +