From 1c2235af5a26c2a608ece80fae7b3d37d34b9eda Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 24 Dec 2018 09:44:26 -0500 Subject: [PATCH] Explicitly find and complain about BungeeCord and Bukkit plugins. They aren't supported with Velocity and will never be. --- .../proxy/plugin/loader/JavaPluginLoader.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java index 167d93427..7f29712fe 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java @@ -83,6 +83,7 @@ public class JavaPluginLoader implements PluginLoader { private Optional getSerializedPluginInfo(Path source) throws Exception { + boolean foundBungeeBukkitPluginFile = false; try (JarInputStream in = new JarInputStream( new BufferedInputStream(Files.newInputStream(source)))) { JarEntry entry; @@ -93,6 +94,16 @@ public class JavaPluginLoader implements PluginLoader { .fromJson(pluginInfoReader, SerializedPluginDescription.class)); } } + + if (entry.getName().equals("plugin.yml") || entry.getName().equals("bungee.yml")) { + foundBungeeBukkitPluginFile = true; + } + } + + if (foundBungeeBukkitPluginFile) { + throw new InvalidPluginException("The plugin file " + source.getFileName() + " appears to " + + "be a Bukkit or BungeeCord plugin. Velocity does not support Bukkit or BungeeCord " + + "plugins."); } return Optional.empty();