类org.bukkit.plugin.InvalidPluginException源码实例Demo

下面列出了怎么用org.bukkit.plugin.InvalidPluginException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: PGM   文件: RuntimePluginLoader.java
@Override
public Plugin loadPlugin(File file) throws UnknownDependencyException, InvalidPluginException {
  return loader.loadPlugin(file);
}
 
源代码2 项目: VoxelGamesLibv2   文件: LoggedPluginManager.java
@Override
public Plugin loadPlugin(File file)
        throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException {
    return delegate.loadPlugin(file);
}
 
源代码3 项目: NovaGuilds   文件: LoggedPluginManager.java
@Override
public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException {
	return delegate.loadPlugin(file);
}
 
源代码4 项目: Lukkit   文件: Main.java
@Override
public void onLoad() {
    // Set the logger and instance
    logger = this.getLogger();
    instance = this;

    // Create the data folder directory if it doesn't exist
    if (!this.getDataFolder().exists()) //noinspection ResultOfMethodCallIgnored
        this.getDataFolder().mkdir();

    // Check the config
    this.checkConfig();

    // Initialize the Lua env (sets up globals)
    LuaEnvironment.init(this.getConfig().getBoolean("lua-debug"));

    // Save the plugin manager for future use
    this.pluginManager = this.getServer().getPluginManager();
    // Register our custom plugin loader on the plugin manager
    this.pluginManager.registerInterface(LukkitPluginLoader.class);

    this.getLogger().info("Loading Lukkit plugins...");

    // Get the files in the plugins directory
    File[] plugins = this.getFile().getParentFile().listFiles();

    if (plugins != null) {
        // Set the start time of loading
        long startTime = System.currentTimeMillis();

        for (File file : plugins) {
            // "break" if the file isn't for Lukkit
            if (isLukkitPluginFile(file.getName())) {
                // Load the plugin using LukkitPluginLoader
                try {
                    this.pluginManager.loadPlugin(file);
                } catch (InvalidPluginException | InvalidDescriptionException e) {
                    LuaEnvironment.addError(e);
                    e.printStackTrace();
                }
            }
        }

        // Get the total time to load plugins and save to loadTime member
        loadTime = System.currentTimeMillis() - startTime;
    }

    for (Plugin plugin : this.pluginManager.getPlugins()) {
        if (plugin instanceof LukkitPlugin) {
            this.pluginLoader = (LukkitPluginLoader) plugin.getPluginLoader();
            break;
        }
    }
}
 
 类所在包
 同包方法