Java 类org.bukkit.plugin.UnknownDependencyException 实例源码

项目:MockBukkit    文件:PluginManagerMock.java   
@Override
public Plugin loadPlugin(File file)
        throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
项目:UnlimitedPlugins    文件:UnlimitedPlugins.java   
public Plugin loadPlugin(CommandSender sender, File f, ArrayList<Plugin> loaded) {
    Plugin pl = null;
    for (Plugin pll : loaded) {
        if (pll.getName().equals(f.getName().replaceAll(".jar", ""))) {
            return null;
        }
    }
    try {
        pl = Bukkit.getPluginManager().loadPlugin(f);
    } catch (UnknownDependencyException | InvalidPluginException | InvalidDescriptionException e) {
        if (e instanceof UnknownDependencyException) {
            sender.sendMessage("[UnlimitedPlugins] Tried to load the jar, " + f.getName()
                    + " but failed because the required dependencies wheren't found.");
        } else if (e instanceof InvalidPluginException) {
            sender.sendMessage("[UnlimitedPlugins] Tried to load the jar, " + f.getName()
                    + " but failed because the jar was invalid.");
        } else if (e instanceof InvalidDescriptionException) {
            sender.sendMessage("[UnlimitedPlugins] Tried to load the jar, " + f.getName()
                    + " but failed because the plugin.yml was invalid.");
        } else {
            sender.sendMessage("[UnlimitedPlugins] Tried to load the jar, " + f.getName()
                    + " but failed because an unknown error occurred.");
        }
        return null;
    }
    if (pl != null) {
        Bukkit.getPluginManager().enablePlugin(pl);
    }
    return pl;
}
项目:economy    文件:SubPluginLoader.java   
public static void valid(SubPlugin sub, PluginDescriptionFile description) throws InvalidPluginException {
    if (Fun.INSTANCE.loaded.contains(sub)) {
        throw new InvalidPluginException("Already loaded by sub-plugin loader");
    } else if (Fun.INSTANCE.map.containsKey(description.getName())) {
        throw new InvalidPluginException("Already loaded by origin");
    }
    for (String depend : description.getDepend()) {
        val load = Fun.INSTANCE.map.get(depend);
        if (load == null || !load.isEnabled()) {
            throw new UnknownDependencyException("Depend plugin " + depend + " not found or enabled");
        }
    }
}
项目:ExilePearl    文件:TestPluginManager.java   
public JavaPlugin loadPlugin(TestPlugin<?> p) throws InvalidPluginException, UnknownDependencyException {
    final JavaPlugin plugin;
    try {
        plugin = (JavaPlugin)p.getPluginClass().newInstance();
    } catch (Exception ex) {
        throw new InvalidPluginException(ex);
    }

       if (plugin != null) {
           plugins.add(plugin);
           lookupNames.put(plugin.getDescription().getName(), plugin);
       }

       return plugin;
}
项目:pexel-platform    文件:BukkitPluginLoader.java   
@Override
public void load(final MinigameDescriptor plugin) {
    try {
        this.plugins.put(plugin, this.internal.loadPlugin(plugin.getJar()));
    } catch (UnknownDependencyException | InvalidPluginException
            | InvalidDescriptionException e) {
        e.printStackTrace();
    }
}
项目:VoxelGamesLibv2    文件:LoggedPluginManager.java   
@Override
public Plugin loadPlugin(File file)
        throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException {
    return delegate.loadPlugin(file);
}
项目:MinigameManager    文件:MinigamePluginManagerWrapper.java   
@Override
public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException {
    return pm.loadPlugin(file);
}
项目:economy    文件:SubPluginLoader.java   
@Override
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException {
    throw new UnsupportedOperationException("Not supported yet");
}
项目:ExilePearl    文件:TestPluginManager.java   
@Override
public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException {
    return null;
}
项目:TagTabAPI    文件:FakePlugin.java   
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException {
    throw new UnsupportedOperationException();
}
项目:NovaGuilds    文件:LoggedPluginManager.java   
@Override
public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException {
    return delegate.loadPlugin(file);
}
项目:GameDispenser    文件:GameLoader.java   
public void loadGameType(File file, GameDescriptionFile description, boolean reload) throws InvalidGameException {
    Validate.notNull(file, "File cannot be null");
    Validate.notNull(description, "Description cannot be null");
    if (!reload) {
        Validate.isTrue(!loaders.containsKey(description.getName()), "Game type already loaded");
    } else {
        loaders.remove(description.getName());
        GameType.remove(GameType.get(description.getName()));
    }

    if (!file.exists()) {
        throw new InvalidGameException(new FileNotFoundException(file.getPath() + " does not exist"));
    }

    for (String game : description.getDepend()) {
        if (loaders == null) {
            throw new UnknownDependencyException(game);
        }

        GameClassLoader current = loaders.get(game);
        if (current == null) {
            throw new UnknownDependencyException(game);
        }
    }

    final File dataFolder = new File(file.getParentFile(), description.getName());

    try {
        if (dataFolder.exists() && !dataFolder.isDirectory()) {
            throw new InvalidGameException(FormatUtil.format(
                    "Projected datafolder: '{0}' for {1} ({2}) exists and is not a directory",
                    dataFolder,
                    description.getFullName(),
                    file
            ));
        }

        GameClassLoader loader = new GameClassLoader(this, file, getClass().getClassLoader(), description);
        new GameType(description.getName(), description, dataFolder, loader);
        loaders.put(description.getName(), loader);
    } catch (Throwable e) {
        throw new InvalidGameException(e);
    }
}
项目:BedrockAPI    文件:SimplePluginManager.java   
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException {
    return null;
}
项目:iTag    文件:TagAPI.java   
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException
{
    throw new UnsupportedOperationException( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates.
}
项目:BedrockAPI    文件:PluginLoader.java   
Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException;
项目:BedrockAPI    文件:PluginManager.java   
Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException;