3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 06:30:16 +02:00

Explicitly find and complain about BungeeCord and Bukkit plugins.

They aren't supported with Velocity and will never be.
Dieser Commit ist enthalten in:
Andrew Steinborn 2018-12-24 09:44:26 -05:00
Ursprung aeed2c0f87
Commit 1c2235af5a

Datei anzeigen

@ -83,6 +83,7 @@ public class JavaPluginLoader implements PluginLoader {
private Optional<SerializedPluginDescription> 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();