public void enableAddons(AddonLoadOrder load) { Addon[] addons = addonManager.getAddons(); for (Addon addon : addons) { if (!addon.isEnabled() && addon.getDescription().getLoad() == load) { loadAddon(addon); } } }
private void loadAddon(Addon addon) { try { addonManager.enableAddon(addon); } catch (Throwable ex) { Logger.getLogger(SpoutClient.class.getName()) .log( Level.SEVERE, ex.getMessage() + " loading " + addon.getDescription().getFullName() + " (Is it up to date?)", ex); } }
public void loadAddons() { addonManager.registerInterface(JavaAddonLoader.class); File addonDir = new File(addonFolder); if (addonDir.exists()) { Addon[] addons = addonManager.loadAddons(addonDir); for (Addon addon : addons) { try { addon.onLoad(); } catch (Throwable ex) { Logger.getLogger(SpoutClient.class.getName()) .log( Level.SEVERE, ex.getMessage() + " initializing " + addon.getDescription().getFullName() + " (Is it up to date?)", ex); } } } else { addonDir.mkdir(); } }
public void disableAddons() { addonManager.disableAddons(); }