@EventHandler
  public static void preInit(FMLPreInitializationEvent e) {
    logger = e.getModLog();
    // config = new Configuration(e.getSuggestedConfigurationFile());

    proxy.preInit();
  }
Exemplo n.º 2
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    logger = event.getModLog();

    WeaponCaseLoot.proxy.preInit(event);

    WCLConfig.init(event.getSuggestedConfigurationFile());
  }
Exemplo n.º 3
0
 @EventHandler
 public void preInit(FMLPreInitializationEvent evt) {
   MEIMConfig.instance();
   MEIMConfig.loadConfig(evt.getSuggestedConfigurationFile());
   MEIMConfig.setLogger(evt.getModLog());
   ItemLoader.load();
   MEIMConfig.saveConfig();
 }
Exemplo n.º 4
0
  @Subscribe
  public void preInit(FMLPreInitializationEvent ev) {
    bukkitLogger = ev.getModLog();
    bukkitLogger.setParent(FMLCommonHandler.instance().getFMLLogger());

    // ServerGUI.logger = bukkitLogger;
    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {

      FMLCommonHandler.instance()
          .getFMLLogger()
          .warning("Bukkit For Vanilla is currently only a server-side mod.");
      return;
    } else if (FMLCommonHandler.instance().getEffectiveSide() == Side.BUKKIT) {
      FMLCommonHandler.instance()
          .getFMLLogger()
          .severe("The bukkit API as a forge mod on bukkit? *mind blown*");
      return;
    }
    this.bukkitLogger.info("Initializing configuration...");
    myConfigurationFile = ev.getSuggestedConfigurationFile();

    Configuration config = new Configuration(myConfigurationFile);
    config.addCustomCategoryComment("consoleConfig", "Configuration for the server console");
    config.addCustomCategoryComment("dontTouchThis", "Things which are best left untouched");

    Property colour =
        config.get(
            "consoleConfig",
            "enablecolour",
            DedicatedServer.getServer().getGuiEnabled() ? false : true);
    colour.comment = "Enable coloured ANSI console output";
    this.allowAnsi = colour.getBoolean(false);

    Property plugins = config.get(Configuration.CATEGORY_GENERAL, "pluginDir", "plugins");
    plugins.comment = "The folder to look for plugins in.";
    this.pluginFolder = plugins.value;

    Property suuid = config.get("dontTouchThis", "serverUUID", this.genUUID());
    bukkitLogger.info("Set UUID to " + suuid.value);
    suuid.comment = "The UUID of the server. Don't touch this or it might break your plugins.";
    this.serverUUID = suuid.value;

    /*Property showAllLogs = config.get(Configuration.CATEGORY_GENERAL, "printForgeLogToGui", false);
    showAllLogs.comment = "Print stuff that's outputted to the logs to the GUI as it happens.";
    this.showAllLogs = showAllLogs.getBoolean(false);*/

    config.save();
  }
Exemplo n.º 5
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    logger = event.getModLog();
    if (event.getSide() == Side.CLIENT) isServer = false;
    else isServer = true;

    // Loads configuration
    config = new ConfigurationHandler();
    FMLCommonHandler.instance().bus().register(config);
    config.init(event.getSuggestedConfigurationFile());

    // registers channel handler
    ChannelHandler.init();

    // Register event handlers
    MinecraftForge.EVENT_BUS.register(ServerTickHandler.instance);
    FMLCommonHandler.instance().bus().register(ServerTickHandler.instance);
    if (event.getSide().isClient()) {
      MinecraftForge.EVENT_BUS.register(ClientTickHandler.instance);
      FMLCommonHandler.instance().bus().register(ClientTickHandler.instance);
    }
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    CrossModLoader.preinit();
  }
Exemplo n.º 6
0
 @Mod.EventHandler
 public static void preInit(FMLPreInitializationEvent event) {
   logger = event.getModLog();
   ModItems.init();
 }
  @Override
  @SuppressWarnings({"unchecked", "rawtypes"})
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    Objects.log = event.getModLog();

    ModHeldsPeripherals.packetHandler =
        new PacketHandler<HeldsPeripheralsPacket>(Objects.MOD_CHANNEL, Packet1PlaySound.class);

    // Config
    this.config = new Config(event.getSuggestedConfigurationFile());

    ConfigCategory<?> category =
        new ConfigCategory(
            Configuration.CATEGORY_GENERAL,
            "config.heldsperipherals.category.general",
            null,
            "General mod settings");
    this.config.addCategory(category);
    ModHeldsPeripherals.fireworksEntityId =
        new ConfigValue<Integer>(
            "fireworksEntityId",
            "config.heldsperipherals.key.FireworksEntityID",
            null,
            160,
            "The entity ID for the custom fireworks entity");
    ModHeldsPeripherals.enhancedFireworksEntity =
        new ConfigValue<Boolean>(
            "enhancedFireworksEntity",
            "config.heldsperipherals.key.EnhancedFireworks",
            Side.CLIENT,
            Boolean.TRUE,
            "Determines whether fireworks launched by the Electrical Fireworks Lighter create grouped particles");
    ModHeldsPeripherals.enhancedEnderChargeRenderer =
        new ConfigValue<Boolean>(
            "enhancedEnderChargeRenderer",
            "config.heldsperipherals.key.EnhancedEnderChargeRenderer",
            Side.CLIENT,
            Boolean.TRUE,
            "Determines whether ender charges render with a charge amount counter");
    category.addValue(ModHeldsPeripherals.fireworksEntityId);
    category.addValue(ModHeldsPeripherals.enhancedFireworksEntity);
    category.addValue(ModHeldsPeripherals.enhancedEnderChargeRenderer);

    category =
        new ConfigCategory(
            "charges", "config.heldsperipherals.category.charges", null, "Ender Charge settings");
    this.config.addCategory(category);
    ModHeldsPeripherals.chargeYieldEnderPearl =
        new ConfigValue<Integer>(
            "chargeYieldEnderPearl",
            "config.heldsperipherals.key.YieldEnderPearl",
            null,
            40,
            "The amount of ender charges an ender pearl is worth");
    ModHeldsPeripherals.chargeYieldEyeOfEnder =
        new ConfigValue<Integer>(
            "chargeYieldEyeOfEnder",
            "config.heldsperipherals.key.YieldEyeOfEnder",
            null,
            60,
            "The amount of ender charges an eye of ender is worth");
    ModHeldsPeripherals.chargeYieldEnderPearlDust =
        new ConfigValue<Integer>(
            "chargeYieldEnderPearlDust",
            "config.heldsperipherals.key.YieldEnderPearlDust",
            null,
            40,
            "The amount of charges one ender pearl dust is worth (GregTech Compat)");
    ModHeldsPeripherals.chargeYieldEyeOfEnderDust =
        new ConfigValue<Integer>(
            "chargeYieldEyeOfEnderDust",
            "config.heldsperipherals.key.YieldEyeOfEnderDust",
            null,
            30,
            "The amount of charges one eye of ender dust is worth (GrehTech Compat)");
    ModHeldsPeripherals.chargeCostSend =
        new ConfigValue<Integer>(
            "chargeCostSend",
            "config.heldsperipherals.key.CostSend",
            null,
            1,
            "The amount of charges that are required to send a text message");
    ModHeldsPeripherals.chargeCostTransport =
        new ConfigValue<Integer>(
            "chargeCostTransport",
            "config.heldsperipherals.key.CostTransport",
            null,
            5,
            "The amount of charges that are required to send matter");
    ModHeldsPeripherals.chargeCostostTransportFluid =
        new ConfigValue<Integer>(
            "chargeCostostTransportFluid",
            "config.heldsperipherals.key.CostTransportFluid",
            null,
            4,
            "The amount of charges that are required to send fluid");
    category.addValue(ModHeldsPeripherals.chargeYieldEnderPearl);
    category.addValue(ModHeldsPeripherals.chargeYieldEyeOfEnder);
    category.addValue(ModHeldsPeripherals.chargeYieldEnderPearlDust);
    category.addValue(ModHeldsPeripherals.chargeYieldEyeOfEnderDust);
    category.addValue(ModHeldsPeripherals.chargeCostSend);
    category.addValue(ModHeldsPeripherals.chargeCostTransport);
    category.addValue(ModHeldsPeripherals.chargeCostostTransportFluid);

    super.preInit(event);
  }