當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。