예제 #1
0
  void pluginEnable(String pluginName) {
    ProtectionPlugins protectionPlugin;
    try {
      protectionPlugin = ProtectionPlugins.valueOf(pluginName);
    } catch (Exception e1) {
      return;
    }

    if (protectionPlugin.isEnabled()) {
      try {
        this.instance.getLogger().info("Loading protection plugin: " + pluginName);
        protectionPlugin.createHandler();
      } catch (InstantiationException | IllegalAccessException e) {
        e.printStackTrace();
      }
    }
  }