Пример #1
0
  public void enableAddons(AddonLoadOrder load) {
    Addon[] addons = addonManager.getAddons();

    for (Addon addon : addons) {
      if (!addon.isEnabled() && addon.getDescription().getLoad() == load) {
        loadAddon(addon);
      }
    }
  }
Пример #2
0
 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);
   }
 }
Пример #3
0
  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();
    }
  }
Пример #4
0
 public void disableAddons() {
   addonManager.disableAddons();
 }