@Override public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException { // TODO Auto-generated method stub throw new UnimplementedOperationException(); }
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; }
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"); } } }
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; }
@Override public void load(final MinigameDescriptor plugin) { try { this.plugins.put(plugin, this.internal.loadPlugin(plugin.getJar())); } catch (UnknownDependencyException | InvalidPluginException | InvalidDescriptionException e) { e.printStackTrace(); } }
@Override public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException { return delegate.loadPlugin(file); }
@Override public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException { return pm.loadPlugin(file); }
@Override public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException { throw new UnsupportedOperationException("Not supported yet"); }
@Override public Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException { return null; }
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException { throw new UnsupportedOperationException(); }
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); } }
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException { return null; }
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException { throw new UnsupportedOperationException( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. }
Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException;
Plugin loadPlugin(File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException;