mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 20:51:47 +01:00
No longer supporting the TSLPC (inb4pitchforks)
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
d88a7b4f90
commit
e2042c4cfa
@ -25,29 +25,6 @@ public abstract class JavaPlugin implements Plugin {
|
||||
private ClassLoader classLoader = null;
|
||||
private Configuration config = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Java plugin instance
|
||||
*
|
||||
* @param pluginLoader PluginLoader that is responsible for this plugin
|
||||
* @param instance Server instance that is running this plugin
|
||||
* @param desc PluginDescriptionFile containing metadata on this plugin
|
||||
* @param folder Folder containing the plugin's data
|
||||
* @param plugin File containing this plugin
|
||||
* @param cLoader ClassLoader which holds this plugin
|
||||
*/
|
||||
public JavaPlugin(PluginLoader pluginLoader, Server instance,
|
||||
PluginDescriptionFile desc, File folder, File plugin,
|
||||
ClassLoader cLoader) {
|
||||
initialize(pluginLoader, instance, desc, folder, plugin, cLoader);
|
||||
|
||||
server.getLogger().warning("Using the stupidly long constructor " + desc.getMain() + "(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is no longer recommended. Go nag the plugin author of " + desc.getName() + " to remove it! (Nothing is broken, we just like to keep code clean.)");
|
||||
|
||||
ArrayList<String> authors = desc.getAuthors();
|
||||
if (authors.size() > 0) {
|
||||
server.getLogger().info("Hint! It's probably someone called '" + authors.get(0) + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public JavaPlugin() {
|
||||
}
|
||||
|
||||
|
@ -72,14 +72,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
Class<?> jarClass = Class.forName(description.getMain(), true, loader);
|
||||
Class<? extends JavaPlugin> plugin = jarClass.asSubclass(JavaPlugin.class);
|
||||
|
||||
try {
|
||||
Constructor<? extends JavaPlugin> constructor = plugin.getConstructor(PluginLoader.class, Server.class, PluginDescriptionFile.class, File.class, File.class, ClassLoader.class);
|
||||
result = constructor.newInstance(this, server, description, dataFolder, file, loader);
|
||||
} catch (NoSuchMethodException ex) {
|
||||
Constructor<? extends JavaPlugin> constructor = plugin.getConstructor();
|
||||
result = constructor.newInstance();
|
||||
}
|
||||
|
||||
Constructor<? extends JavaPlugin> constructor = plugin.getConstructor();
|
||||
result = constructor.newInstance();
|
||||
|
||||
result.initialize(this, server, description, dataFolder, file, loader);
|
||||
} catch (Throwable ex) {
|
||||
throw new InvalidPluginException(ex);
|
||||
|
Loading…
Reference in New Issue
Block a user