cpw.mods.fml.common.event.FMLPreInitializationEvent Java Examples

The following examples show how to use cpw.mods.fml.common.event.FMLPreInitializationEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OpenPeripheralCore.java    From OpenPeripheral with MIT License 6 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt) {
	apiSetup.installHolderAccess(evt.getAsmData());
	PeripheralTypeProvider.INSTANCE.initialize(evt.getModConfigurationDirectory());

	final File configFile = evt.getSuggestedConfigurationFile();
	config = new Configuration(configFile);
	ConfigProcessing.processAnnotations(ModInfo.ID, config, Config.class);
	if (config.hasChanged()) config.save();

	FeatureGroupManager.INSTANCE.loadBlacklist(Config.featureGroupsBlacklist);
	FMLCommonHandler.instance().bus().register(new ConfigGuiFactory.ConfigChangeListener(config));

	MinecraftForge.EVENT_BUS.register(TileEntityBlacklist.INSTANCE);

	FMLInterModComms.sendMessage(Mods.OPENCOMPUTERS, "blacklistPeripheral", IOpenPeripheral.class.getName());

	TypeClassifier.INSTANCE.registerClassifier(new MinecraftTypeClassifier());

	FeatureGroupManager.INSTANCE.loadFeatureGroupsFromAnnotations(evt.getAsmData());
}
 
Example #2
Source File: EtFuturum.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	ConfigurationHandler.INSTANCE.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.MOD_ID + ".cfg"));

	GameRegistry.registerWorldGenerator(new EtFuturumWorldGenerator(), 0);

	ModBlocks.init();
	ModItems.init();
	ModEnchantments.init();

	OceanMonument.makeMap();

	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
	networkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MOD_ID);
	networkWrapper.registerMessage(ArmourStandInteractHandler.class, ArmourStandInteractMessage.class, 0, Side.SERVER);
	networkWrapper.registerMessage(BlackHeartParticlesHandler.class, BlackHeartParticlesMessage.class, 1, Side.CLIENT);
	networkWrapper.registerMessage(SetPlayerModelHandler.class, SetPlayerModelMessage.class, 2, Side.CLIENT);
}
 
Example #3
Source File: MyTown.java    From MyTown2 with The Unlicense 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent ev) {
    // Setup Loggers
    LOG = ev.getModLog();

    Constants.CONFIG_FOLDER = ev.getModConfigurationDirectory().getPath() + "/MyTown/";

    // Read Configs
    Config.instance.init(Constants.CONFIG_FOLDER + "/MyTown.cfg", Constants.MODID);
    LOCAL = new Local(Constants.CONFIG_FOLDER+"/localization/", Config.instance.localization.get(), "/mytown/localization/", MyTown.class);
    LocalManager.register(LOCAL, "mytown");

    registerHandlers();

    // Register ICrashCallable's
    FMLCommonHandler.instance().registerCrashCallable(new DatasourceCrashCallable());
}
 
Example #4
Source File: RenderUtility.java    From NOVA-Core with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent event) {
	//Load models
	Game.render().modelProviders.forEach(m -> {
		ResourceLocation resource = new ResourceLocation(m.domain, "models/" + m.name + "." + m.getType());
		try {
			IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resource);
			m.load(res.getInputStream());
		} catch (IOException e) {
			throw new ModelFormatException("IO Exception reading model format", e);
		}
	});
}
 
Example #5
Source File: BRLoader.java    From BigReactors with MIT License 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	BigReactors.registerOres(0, true);
	BigReactors.registerIngots(0);
	BigReactors.registerFuelRods(0, true);
	BigReactors.registerReactorPartBlocks(0, true);
	BigReactors.registerTurbineParts();
	BigReactors.registerDevices(0,  true);
	BigReactors.registerFluids(0,  true);
	BigReactors.registerCreativeParts(0, true);
	BigReactors.registerItems();

	StandardReactants.register();
	
	BigReactors.eventHandler = new BREventHandler();
	MinecraftForge.EVENT_BUS.register(BigReactors.eventHandler);
	MinecraftForge.EVENT_BUS.register(proxy);
	
	multiblockEventHandler = new MultiblockEventHandler();
	MinecraftForge.EVENT_BUS.register(multiblockEventHandler);
	
	proxy.preInit();
	
	Fluid waterFluid = FluidRegistry.WATER; // Force-load water to prevent startup crashes
}
 
Example #6
Source File: AdvancedMod.java    From AdvancedMod with GNU General Public License v3.0 6 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    ModBlocks.init();
    ModTileEntities.init();
    proxy.preInit();
    GameRegistry.registerWorldGenerator(new WorldGeneratorFlag(), 0);
    NetworkHandler.init();
    DescriptionHandler.init();
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
    MinecraftForge.EVENT_BUS.register(new AdvancedModEventHandler());//For registering events from the net.miencraftforge.event package.
    FMLCommonHandler.instance().bus().register(new AdvancedModEventHandler());//For registering events from the cpw.mods.fml.gameevent package.
    FMLInterModComms.sendMessage(Reference.MOD_ID, "camoMineBlacklist", new ItemStack(Blocks.stone));
    FMLInterModComms.sendMessage("Waila", "register", "com.minemaarten.advancedmod.thirdparty.waila.Waila.onWailaCall");
    Log.info("Pre Initialization Complete!");

    if(Loader.isModLoaded("Thaumcraft")) {
        loadThaumcraft();
    }
}
 
Example #7
Source File: Forbidden.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 6 votes vote down vote up
@EventHandler
public void prelude(FMLPreInitializationEvent event) {
    instance = this;
    Config.configurate(event.getSuggestedConfigurationFile());
    if (Config.wrathCage)
        crysTab = new CreativeTabs("mobcrystal"){
            @Override
            public Item getTabIconItem() {
                return ForbiddenItems.mobCrystal;
            }
        };
    Compat.initiate();
    DarkAspects.initAspects();
    Config.spawnilify();
    ForbiddenItems.addItems();
    ForbiddenBlocks.addBlocks();
    DarkEnchantments.hex();
    if(Compat.bm)
        DarkPotions.alchemize();
    proxy.registerRenderInfo();
}
 
Example #8
Source File: DebugLog.java    From bartworks with MIT License 6 votes vote down vote up
public static void initDebugLog(FMLPreInitializationEvent event) throws IOException {
    if (DebugLog.init)
        return;
    DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString());
    DebugLog.utilLog = Logger.getLogger("DebugLog");
    DebugLog.utilLog.setUseParentHandlers(false);
    DebugLog.utilLog.addHandler(DebugLog.fh);
    Formatter formatter = new Formatter() {
        @Override
        public String format(LogRecord record) {
            SimpleDateFormat logTime = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
            Calendar cal = new GregorianCalendar();
            cal.setTimeInMillis(record.getMillis());
            return "Level: " + record.getLevel()
                    +" at " + logTime.format(cal.getTime())
                    + " " + record.getMessage() + "\n";
        }
    };
    DebugLog.fh.setFormatter(formatter);
    DebugLog.init = true;
}
 
Example #9
Source File: Chisel.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {

	File configFile = event.getSuggestedConfigurationFile();
	Configurations.configExists = configFile.exists();
	Configurations.config = new Configuration(configFile);
	Configurations.config.load();
	Configurations.refreshConfig();

	ChiselTabs.preInit();
	Features.preInit();
	Statistics.init();
	PacketHandler.init();
	ChiselController.INSTANCE.preInit();
	if (Loader.isModLoaded("ForgeMultipart")) {
		new FMPCompat().init();
	}
	proxy.preInit();
}
 
Example #10
Source File: NEIIntegration.java    From NEI-Integration with MIT License 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
    if (evt.getSide() != Side.CLIENT) {
        return;
    }
    
    log = evt.getModLog();
    log.info("Starting NEI Integration");
    
    integrations = Integrations.getIntegrations();
    Config.preInit(evt);
}
 
Example #11
Source File: GardenTrees.java    From GardenCollection with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void preInit (FMLPreInitializationEvent event) {
    config = new ConfigManager(new File(event.getModConfigurationDirectory(), "GardenStuff/" + MOD_ID + ".cfg"));

    blocks.init();
    items.init();
}
 
Example #12
Source File: MoCProxy.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
public void ConfigInit(FMLPreInitializationEvent event) 
{
    configPreEvent = event;
    MoCconfig = new MoCConfiguration(new File(event.getSuggestedConfigurationFile().getParent(), "MoCProperties.cfg"));
    MoCBiomeConfig = new MoCConfiguration(new File(event.getSuggestedConfigurationFile().getParent(), "MoCBiomeGroups.cfg"));
    configFile = event.getSuggestedConfigurationFile();
    MoCconfig.load();
    MoCBiomeConfig.load();
    this.readConfigValues();
    if (debugLogging) MoCreatures.log.info("Initializing MoCreatures Server Config File at " + event.getSuggestedConfigurationFile().getParent() + "MoCProperties.cfg");
}
 
Example #13
Source File: BartWorksCrossmod.java    From bartworks with MIT License 5 votes vote down vote up
@Mod.EventHandler
    public void preInit(FMLPreInitializationEvent preinit) {
//        if (LoaderReference.appliedenergistics2)
//            new ItemSingleItemStorageCell("singleItemStorageCell");
        if (LoaderReference.GalacticraftCore)
            GalacticraftProxy.preInit(preinit);
        if (LoaderReference.Thaumcraft)
            new CustomAspects();
    }
 
Example #14
Source File: PneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void PreInit(FMLPreInitializationEvent event){
    event.getModMetadata().version = Versions.fullVersionString();
    isNEIInstalled = Loader.isModLoaded(ModIds.NEI);

    PneumaticRegistry.init(PneumaticCraftAPIHandler.getInstance());
    UpgradeRenderHandlerList.init();
    SensorHandler.init();
    Config.init(event.getSuggestedConfigurationFile());
    ThirdPartyManager.instance().index();

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    tabPneumaticCraft = new CreativeTabPneumaticCraft("tabPneumaticCraft");
    Fluids.initFluids();
    Blockss.init();
    Itemss.init();
    HackableHandler.addDefaultEntries();
    ModuleRegistrator.init();
    WidgetRegistrator.init();
    ThirdPartyManager.instance().preInit();
    TileEntityRegistrator.init();
    EntityRegistrator.init();
    SemiBlockInitializer.init();
    CraftingRegistrator.init();
    VillagerHandler.instance().init();
    GameRegistry.registerWorldGenerator(new WorldGeneratorPneumaticCraft(), 0);
    AchievementHandler.init();
    HeatBehaviourManager.getInstance().init();

    proxy.registerRenders();
    proxy.registerHandlers();
    tickHandler = new TickHandlerPneumaticCraft();
    FMLCommonHandler.instance().bus().register(tickHandler);
    MinecraftForge.EVENT_BUS.register(new EventHandlerPneumaticCraft());
    MinecraftForge.EVENT_BUS.register(new EventHandlerUniversalSensor());
    MinecraftForge.EVENT_BUS.register(new DroneSpecialVariableHandler());

    FMLCommonHandler.instance().bus().register(new CraftingHandler());
    FMLCommonHandler.instance().bus().register(new Config());
}
 
Example #15
Source File: GalacticraftProxy.java    From bartworks with MIT License 5 votes vote down vote up
private static void commonpreInit(FMLPreInitializationEvent e) {
    GalacticraftProxy.gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg"));
    GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid");
    BW_WorldGenRoss128b.initundergroundFluids();
    BW_WorldGenRoss128ba.init_undergroundFluids();
    if (GalacticraftProxy.gtConf.hasChanged())
        GalacticraftProxy.gtConf.save();
    BW_WorldGenRoss128b.initOres();
    BW_WorldGenRoss128ba.init_Ores();
    MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE);
}
 
Example #16
Source File: GalacticraftProxy.java    From bartworks with MIT License 5 votes vote down vote up
public static void preInit(FMLPreInitializationEvent e) {
    if (SideReference.Side.Server || SideReference.EffectiveSide.Server) {
        GalacticraftProxy.serverpreInit(e);
    } else {
        GalacticraftProxy.clientpreInit(e);
    }
    GalacticraftProxy.commonpreInit(e);
}
 
Example #17
Source File: HexxitGear.java    From HexxitGear with GNU General Public License v3.0 5 votes vote down vote up
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
    HexxitGearConfig.setConfigFolderBase(evt.getModConfigurationDirectory());

    HexxitGearConfig.loadCommonConfig(evt);

    HexxitGearConfig.extractLang(new String[]{"en_US"});
    HexxitGearConfig.loadLang();
    HexxitGearConfig.registerDimBlacklist();

    logger = evt.getModLog();
    playerEventHandler = new PlayerEventHandler();
    MinecraftForge.EVENT_BUS.register(playerEventHandler);
}
 
Example #18
Source File: exaliquo.java    From Ex-Aliquo with MIT License 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	Configurations.Load(event.getModConfigurationDirectory());
	Registries.exatab = new ExATab("ExA");
	Registries.oretab = new ExAOreTab("ExAOres");
	Registries.registerItems();
	Registries.registerBlocks();
	Registries.registerRecipes();
	Registries.exatab.initTab(new ItemStack(Registries.crookGold, 1, 0));
	Registries.oretab.initTab(new ItemStack(Registries.cobaltOreItem, 1, 0));
	
	MinecraftForge.EVENT_BUS.register(new AliquoEvents());
	TickRegistry.registerTickHandler(new AliquoTickHandler(), Side.CLIENT);
}
 
Example #19
Source File: LookingGlass.java    From LookingGlass with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preinit(FMLPreInitializationEvent event) {
	//Initialize the packet handling
	LookingGlassPacketManager.registerPacketHandler(new PacketCreateView(), (byte) 10);
	LookingGlassPacketManager.registerPacketHandler(new PacketCloseView(), (byte) 11);
	LookingGlassPacketManager.registerPacketHandler(new PacketWorldInfo(), (byte) 100);
	LookingGlassPacketManager.registerPacketHandler(new PacketChunkInfo(), (byte) 101);
	LookingGlassPacketManager.registerPacketHandler(new PacketTileEntityNBT(), (byte) 102);
	LookingGlassPacketManager.registerPacketHandler(new PacketRequestWorldInfo(), (byte) 200);
	LookingGlassPacketManager.registerPacketHandler(new PacketRequestChunk(), (byte) 201);
	LookingGlassPacketManager.registerPacketHandler(new PacketRequestTE(), (byte) 202);

	LookingGlassPacketManager.bus = NetworkRegistry.INSTANCE.newEventDrivenChannel(LookingGlassPacketManager.CHANNEL);
	LookingGlassPacketManager.bus.register(new LookingGlassPacketManager());

	// Load our basic configs
	ModConfigs.loadConfigs(new Configuration(event.getSuggestedConfigurationFile()));

	// Here we use the recommended config file to establish a good place to put a log file for any proxy world error logs.  Used primarily to log the full errors when ticking or rendering proxy worlds. 
	File configroot = event.getSuggestedConfigurationFile().getParentFile();
	// Main tick handler. Handles FML events.
	FMLCommonHandler.instance().bus().register(new LookingGlassEventHandler(new File(configroot.getParentFile(), "logs/proxyworlds.log")));
	// Forge event handler
	MinecraftForge.EVENT_BUS.register(new LookingGlassForgeEventHandler());

	// Initialize the API provider system.  Beware, this way be dragons.
	APIProviderImpl.init();
}
 
Example #20
Source File: HexxitGearConfig.java    From HexxitGear with GNU General Public License v3.0 5 votes vote down vote up
public static void loadCommonConfig(FMLPreInitializationEvent evt)
{
    Configuration c = new Configuration(evt.getSuggestedConfigurationFile());
    try {
        c.load();

        hexbiscus = c.getBlock("ID.HexbiscusFlower", 2400);

        tribalHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalHelmet", 26200);
        tribalChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalChest", 26201);
        tribalLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalLeggings", 26202);
        tribalShoesId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalShoes", 26203);

        scaleHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleHelmet", 26204);
        scaleChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleChest", 26205);
        scaleLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleLeggings", 26206);
        scaleBootsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleBoots", 26207);

        thiefHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefHelmet", 26208);
        thiefChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefChest", 26209);
        thiefLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefLeggings", 26210);
        thiefBootsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefBoots", 26211);

        hexicalEssence = c.getItem(Configuration.CATEGORY_ITEM, "ID.HexicalEssence", 26212);
        hexicalDiamond = c.getItem(Configuration.CATEGORY_ITEM, "ID.HexicalDiamond", 26213);

        dimensionalBlacklist = c.get("World Generation", "Dimensional Blacklist", "");
        dimensionalBlacklist.comment = "Comma separated list of all blacklisted dimension IDs";

    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        c.save();
    }
}
 
Example #21
Source File: BurlapCraft.java    From burlapcraft with GNU Lesser General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	

	burlapStone = new BlockBurlapStone();
	redRock = new BlockRedRock();
	blueRock = new BlockBlueRock();
	orangeRock = new BlockOrangeRock();
	greenRock = new BlockGreenRock();
	mineableRedRock = new BlockMineableRedRock();
	mineableOrangeRock = new BlockMineableOrangeRock();
	mineableGreenRock = new BlockMineableGreenRock();
	mineableBlueRock = new BlockMineableBlueRock();
	
	// make sure minecraft knows
	GameRegistry.registerBlock(burlapStone, "burlapstone");
	GameRegistry.registerBlock(redRock, "redrock");
	GameRegistry.registerBlock(blueRock, "bluerock");
	GameRegistry.registerBlock(greenRock, "greenrock");
	GameRegistry.registerBlock(orangeRock, "orangerock");
	GameRegistry.registerBlock(mineableRedRock, "mineableRedRock");
	GameRegistry.registerBlock(mineableGreenRock, "mineableGreenRock");
	GameRegistry.registerBlock(mineableBlueRock, "mineableBlueRock");
	GameRegistry.registerBlock(mineableOrangeRock, "mineableOrangeRock");
	GameRegistry.registerWorldGenerator(genHandler, 0);
	
	MinecraftForge.EVENT_BUS.register(eventHandler);
	// FMLCommonHandler.instance().bus().register(fmlHandler);
	
}
 
Example #22
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
@PreInit
public void preInit(FMLPreInitializationEvent event)
{
    MinecraftForge.TERRAIN_GEN_BUS.register(new MoCEventHooks()); // register our event subscriptions
    log = event.getModLog();
    // check if config exists, if not then copy default
    File mocConfigFile = new File(event.getSuggestedConfigurationFile().getParent() + File.separator + "MoCProperties.cfg");

    if (!mocConfigFile.exists())
    {
        log.info("could not find MoCProperties.cfg, copying defaults...");
        try {
            InputStream is = getClass().getResourceAsStream("/drzhark/mocreatures/resources/MoCProperties.cfg");
            OutputStream out = new FileOutputStream(mocConfigFile);
            int read = 0;
            byte[] bytes = new byte[1024];

            while ((read = is.read(bytes)) != -1) {
            out.write(bytes, 0, read);
            }

            is.close();
            out.flush();
            out.close();

            log.info("MoCPropeties.cfg has been created successfully!");
        } catch (IOException e) {
            log.warning("unable to create MoCProperties.cfg!!");
            e.printStackTrace();
        }
    }
    proxy.ConfigInit(event);
    proxy.initSounds();
}
 
Example #23
Source File: ElectroMagicTools.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    ElectroMagicTools.logger.info(localize("console.EMT.preInit.begin"));

    ConfigHandler.init(event.getSuggestedConfigurationFile());
    FMLCommonHandler.instance().bus().register(new EventHandlerEMT());
 ModuleRegistry.registerModules();
    EssentiasOutputs.addPrimalOutputs();
    EssentiasOutputs.addOutputs();

    ElectroMagicTools.logger.info(localize("console.EMT.preInit.end"));
}
 
Example #24
Source File: GardenContainers.java    From GardenCollection with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void preInit (FMLPreInitializationEvent event) {
    config = new ConfigManager(new File(event.getModConfigurationDirectory(), MOD_ID + ".patterns.cfg"));

    blocks.init();
    items.init();
}
 
Example #25
Source File: LetsModReboot.java    From LetsModReboot with GNU General Public License v3.0 5 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    ConfigurationHandler.init(event.getSuggestedConfigurationFile());
    FMLCommonHandler.instance().bus().register(new ConfigurationHandler());

    proxy.registerKeyBindings();

    ModItems.init();

    ModBlocks.init();

    LogHelper.info("Pre Initialization Complete!");
}
 
Example #26
Source File: NBTEdit.java    From NBTEdit with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event){
	ModMetadata modMeta = event.getModMetadata();
	modMeta.authorList = Arrays.asList(new String[] { "Davidee" });
	modMeta.autogenerated = false;
	modMeta.credits = "Thanks to Mojang, Forge, and all your support.";
	modMeta.description = "Allows you to edit NBT Tags in-game.\nPlease visit the URL above for help.";
	modMeta.url = "http://www.minecraftforum.net/topic/1558668-151/";
	
	
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	opOnly = config.get("General", "opOnly", true, "true if only Ops can NBTEdit; false allows users in creative mode to NBTEdit").getBoolean(true);
	config.save();
}
 
Example #27
Source File: SimplyJetpacks.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
@EventHandler
public static void preInit(FMLPreInitializationEvent evt) {
    logger = evt.getModLog();
    logger.info("Starting Simply Jetpacks");
    
    checkCoFHLib();
    
    Packs.preInit();
    Config.preInit(evt);
    ModItems.preInit();
}
 
Example #28
Source File: Config.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
public static void preInit(FMLPreInitializationEvent evt) {
    FMLCommonHandler.instance().bus().register(new Config());
    
    config = new Configuration(new File(evt.getModConfigurationDirectory(), SimplyJetpacks.MODID + ".cfg"));
    configClient = new Configuration(new File(evt.getModConfigurationDirectory(), SimplyJetpacks.MODID + "-client.cfg"));
    
    syncConfig();
    SimplyJetpacks.proxy.updateCustomKeybinds(flyKey, descendKey);
}
 
Example #29
Source File: GardenCore.java    From GardenCollection with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void preInit (FMLPreInitializationEvent event) {
    config = new ConfigManager(new File(event.getModConfigurationDirectory(), "GardenStuff/" + MOD_ID + ".cfg"));

    blocks.init();
    items.init();
}
 
Example #30
Source File: BWCore.java    From bartworks with MIT License 5 votes vote down vote up
@Subscribe
public void preInit(FMLPreInitializationEvent event) {
    shouldTransform[0] = ConfigHandler.enabledPatches[0];
    shouldTransform[1] = ConfigHandler.enabledPatches[1];
    shouldTransform[3] = ConfigHandler.enabledPatches[3];
    shouldTransform[4] = true;
    shouldTransform[5] = ConfigHandler.enabledPatches[5];
    shouldTransform[6] = ConfigHandler.enabledPatches[6];
    //shouldTransform[6] = true;
    BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]);
    BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]);
    BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]);
}