コード例 #1
0
  public void preLoad(FMLPreInitializationEvent e) {
    OutputHandler.SOP("Discovering and loading modules...");
    OutputHandler.SOP(
        "If you would like to disable a module, please look in ForgeEssentials/core.cfg.");

    modules = new ArrayList<IFEModule>();
    IFEModule instance;

    /*
     * commands = new ModuleCommands();
     * permission = new ModulePermissions();
     * worldborder = new ModuleWorldBorder();
     * playerLogger = new ModulePlayerLogger();
     * economy = new ModuleEconomy();
     * chat = new ModuleChat();
     * protection = new ModuleProtection();
     * snooper = new ModuleSnooper();
     */

    try {
      instance = new ModuleWorldControl();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleBackup();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleCommands();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModulePermissions();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleWorldBorder();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModulePlayerLogger();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleEconomy();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleChat();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleProtection();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    try {
      instance = new ModuleSnooper();
      modules.add(instance);
      OutputHandler.SOP("discoverred " + instance.getClass().toString());
    } catch (NoClassDefFoundError e1) {
      // Nothing to see here, carry on, carry on
    }

    for (IFEModule module : modules) module.preLoad(e);

    boolean generate = false;
    for (IFEModule module : modules) {
      IModuleConfig cfg = module.getConfig();

      if (cfg != null) {
        File file = cfg.getFile();

        if (!file.getParentFile().exists()) {
          generate = true;
          file.getParentFile().mkdirs();
        }

        if (!generate && (!file.exists() || !file.isFile())) generate = true;

        cfg.setGenerate(generate);
        cfg.init();
      }
    }
  }
コード例 #2
0
 public void reloadConfigs(ICommandSender sender) {
   for (IFEModule module : modules) module.getConfig().forceLoad(sender);
 }
コード例 #3
0
 public void serverStopping(FMLServerStoppingEvent e) {
   for (IFEModule module : modules) module.serverStopping(e);
 }
コード例 #4
0
 public void serverStarted(FMLServerStartedEvent e) {
   for (IFEModule module : modules) module.serverStarted(e);
 }
コード例 #5
0
 public void postLoad(FMLPostInitializationEvent e) {
   for (IFEModule module : modules) module.postLoad(e);
 }
コード例 #6
0
 public void load(FMLInitializationEvent e) {
   for (IFEModule module : modules) module.load(e);
 }