当前位置: 首页>>代码示例>>Java>>正文


Java FMLPreInitializationEvent.getModConfigurationDirectory方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getModConfigurationDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java FMLPreInitializationEvent.getModConfigurationDirectory方法的具体用法?Java FMLPreInitializationEvent.getModConfigurationDirectory怎么用?Java FMLPreInitializationEvent.getModConfigurationDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.common.event.FMLPreInitializationEvent的用法示例。


在下文中一共展示了FMLPreInitializationEvent.getModConfigurationDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
    MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
    McJtyLib.preInit(e);
    CommandHandler.registerCommands();

    MeeCreeps.api.registerFactories();

    File directory = e.getModConfigurationDirectory();
    config = new Configuration(new File(directory.getPath(), "meecreeps.cfg"));
    Config.readConfig();

    SimpleNetworkWrapper network = mcjty.lib.network.PacketHandler.registerMessages(MeeCreeps.MODID, "meecreeps");
    MeeCreepsMessages.registerMessages(network);

    // Initialization of blocks and items typically goes here:
    ModEntities.init();
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:18,代码来源:CommonProxy.java

示例2: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {

    Configuration config = new Configuration(new File(e.getModConfigurationDirectory(), "creativezone.cfg"));
    config.load();

    // Check interval (seconds)
    checkInterval = config.getInt("ScanInterval", "config", 1, 1, 60,
            "Sets the interval (in seconds) for scanning player locations");

    // Creative zone radius
    zoneRadius = config.getInt("ZoneRadius", "config", 25, 5, 1000,
            "Sets the radius of the creative zone");

    Property whiteListProp = config.get("config", "Whitelist", new String[0],
            "Gets the list of whitelisted users");
    for (String s : whiteListProp.getStringList()) {
        whitelist.add(s);
    }

    config.save();
}
 
开发者ID:dizzyd,项目名称:creativezone,代码行数:23,代码来源:CreativeZoneMod.java

示例3: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
    File directory = e.getModConfigurationDirectory();
    config = new Configuration(new File(directory.getPath(), "lanolin.cfg"));
    Config.readConfig();

    MinecraftForge.EVENT_BUS.register(new EventHandlerCommon());
}
 
开发者ID:SirLyle,项目名称:Lanolin,代码行数:8,代码来源:CommonProxy.java

示例4: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
 // Read configuration file
    File directory = e.getModConfigurationDirectory();
    config = new Configuration(new File(directory.getPath(), "mobblocker.cfg"));
    Config.readConfig();

    // Initializes blocks
    ModBlocks.init();

    // Initialized TOP and Waila compatibility
    MainCompatHandler.registerWaila();
    MainCompatHandler.registerTOP();
}
 
开发者ID:Maxwell-lt,项目名称:MobBlocker,代码行数:14,代码来源:CommonProxy.java

示例5: getConfigFile

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static Configuration getConfigFile(FMLPreInitializationEvent e)
{
	configFolder = new File(e.getModConfigurationDirectory(), FOLDERNAME);

	File file = new File(e.getModConfigurationDirectory(), FOLDERNAME + "/" + CONFIG_FILENAME);
	return new Configuration(file);
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:8,代码来源:BBConfigFolderLoader.java

示例6: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
  public void preInit(FMLPreInitializationEvent event){
  	
  	configDir = new File(event.getModConfigurationDirectory(), "MobOptions");
  	if(!configDir.exists())
	configDir.mkdirs();
JSONEquipmentReader.makeEquipmentJSON();

  	ConfigHandler.createConfigs(event);
  	
  	CapabilityStats.register();
  	
  	MinecraftForge.EVENT_BUS.register(new MobOptionsEventHandler());
  }
 
开发者ID:bookerthegeek,项目名称:Mob-Option-Redux,代码行数:15,代码来源:MobOptions.java

示例7: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent event)
{
	// Handle configuration
	File configDir = event.getModConfigurationDirectory();
	config = new Configuration(new File(configDir.getPath(), "simplechunks.cfg"));
	try
	{
		config.load();

		GeneralConfig.readConfig(config);
	}
	catch (Exception e)
	{
		SimpleChunks.logger.error("Error loading config file!", e);
	}
	finally
	{
		if (config.hasChanged())
		{
			config.save();
		}
	}

	// Integrate with other mods
	if (Loader.isModLoaded("theoneprobe"))
	{
		TOPCompat.register();
	}

	// Register chunkloading callback
	ForgeChunkManager.setForcedChunkLoadingCallback(SimpleChunks.instance, new ChunkLoadingHandler());
}
 
开发者ID:DarkMorford,项目名称:Simple-Chunks,代码行数:33,代码来源:CommonProxy.java

示例8: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e)
{
    log = e.getModLog();

    setupMetadata(e.getModMetadata());

    configFile = new Configuration(new File(e.getModConfigurationDirectory(), "Purificati Magicae.cfg"));
    config.setup(configFile);

    debug = LogManager.getLogger(MODID + "-debug");

    proxy.setupDrawables();
    getSipRegistry().register();
    TileRegistry.register();
    CapabilityRegistry.register();
    EntityRegistry.register();
    getPapyrusRegistry().setup();
    getExpressionRegistry().setup();
    PMStructureProcessorRegistry.setup();
    getMagibenchRegistry().setup();

    proxy.setupIfTiers();

    proxy.preInit();

}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:28,代码来源:PurMag.java

示例9: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    if (!SchemaHelper.testSchemaVersionNumbers(Loader.instance().activeModContainer().getVersion()))
        throw new RuntimeException("This mod has been incorrectly built; check schema version numbers.");

    if (event.getModMetadata().version.equals("${version}"))
    {
        // The mcmod.info version number is populated by gradle; if we've been built without gradle,
        // via eclipse say, then we can just use the internal version number instead, which comes to us from the version.properties file.
        // (There's no real benefit to doing this; it just looks nicer in the Mod GUI if the version number is filled in.)
        event.getModMetadata().version = Loader.instance().activeModContainer().getVersion();
    }
    // Load the correct configs (client or server)
    File configDir = event.getModConfigurationDirectory();
    File sessionConfigFile = new File(configDir, MODID + event.getSide().toString() + ".cfg");
    File permanentConfigFile = new File(configDir, MODID + event.getSide().toString() + "Permanent.cfg");
    this.sessionConfig = new Configuration(sessionConfigFile);
    this.sessionConfig.load();
    this.permanentConfig = new Configuration(permanentConfigFile);
    this.permanentConfig.load();

    AddressHelper.update(this.sessionConfig);
    ScreenHelper.update(this.permanentConfig);

    network = NetworkRegistry.INSTANCE.newSimpleChannel("Malmo");
    network.registerMessage(ObservationFromFullStatsImplementation.FullStatsRequestMessageHandler.class, ObservationFromFullStatsImplementation.FullStatsRequestMessage.class, 1, Side.SERVER);
    network.registerMessage(ObservationFromGridImplementation.GridRequestMessageHandler.class, ObservationFromGridImplementation.GridRequestMessage.class, 2, Side.SERVER);
    network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 3, Side.CLIENT);	// Malmo messages from server to client
    network.registerMessage(SimpleCraftCommandsImplementation.CraftMessageHandler.class, SimpleCraftCommandsImplementation.CraftMessage.class, 4, Side.SERVER);
    network.registerMessage(AbsoluteMovementCommandsImplementation.TeleportMessageHandler.class, AbsoluteMovementCommandsImplementation.TeleportMessage.class, 5, Side.SERVER);
    network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 6, Side.SERVER);	// Malmo messages from client to server
    network.registerMessage(InventoryCommandsImplementation.InventoryMessageHandler.class, InventoryCommandsImplementation.InventoryMessage.class, 7, Side.SERVER);
    network.registerMessage(DiscreteMovementCommandsImplementation.UseActionMessageHandler.class, DiscreteMovementCommandsImplementation.UseActionMessage.class, 8, Side.SERVER);
    network.registerMessage(DiscreteMovementCommandsImplementation.AttackActionMessageHandler.class, DiscreteMovementCommandsImplementation.AttackActionMessage.class, 9, Side.SERVER);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:37,代码来源:MalmoMod.java

示例10: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent event) {
	configFile = event.getSuggestedConfigurationFile();
	configDirectory = event.getModConfigurationDirectory();
	configPreInit();
	config = new Configuration(configFile);
	configInit();
	config.getCategory(config.CATEGORY_GENERAL).remove("timeToDelete"); // Wouldn't work anywhere else for some reason
	config.save();
}
 
开发者ID:coehlrich,项目名称:chunk-logger,代码行数:10,代码来源:ChunkLoggerConfig.java

示例11: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    MinecraftForge.EVENT_BUS.register(EventHandler.class);

    initPlugins(event.getAsmData());

    File configDir = event.getModConfigurationDirectory();
    File modsDir = new File(configDir.getParent(), "mods");

    registerPackets();

    NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
    ModLoader.initMods(modsDir);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:16,代码来源:CustomStuff4.java

示例12: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	log.info("PreInitializing");
	configFile = event.getModConfigurationDirectory();
	
	proxy.preInit();
}
 
开发者ID:IsakViste,项目名称:RealisticArmorTiers,代码行数:8,代码来源:RealisticArmorTiers.java

示例13: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent e) {
    modConfigDir = e.getModConfigurationDirectory();
    mainConfig = new Configuration(new File(modConfigDir.getPath() + File.separator + "incontrol", "main.cfg"));
    readMainConfig();
}
 
开发者ID:McJty,项目名称:InControl,代码行数:6,代码来源:ConfigSetup.java

示例14: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent e) {
    modConfigDir = e.getModConfigurationDirectory();
    mainConfig = new Configuration(new File(modConfigDir.getPath(), "lector.cfg"));

    readMainConfig();
}
 
开发者ID:McJty,项目名称:Lector,代码行数:7,代码来源:ConfigSetup.java

示例15: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent e) {
    modConfigDir = e.getModConfigurationDirectory();
    mainConfig = new Configuration(new File(modConfigDir.getPath(), "intwheel.cfg"));

    readMainConfig();
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:7,代码来源:ConfigSetup.java


注:本文中的net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getModConfigurationDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。