當前位置: 首頁>>代碼示例>>Java>>正文


Java FMLPreInitializationEvent.getModConfigurationDirectory方法代碼示例

本文整理匯總了Java中cpw.mods.fml.common.event.FMLPreInitializationEvent.getModConfigurationDirectory方法的典型用法代碼示例。如果您正苦於以下問題:Java FMLPreInitializationEvent.getModConfigurationDirectory方法的具體用法?Java FMLPreInitializationEvent.getModConfigurationDirectory怎麽用?Java FMLPreInitializationEvent.getModConfigurationDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cpw.mods.fml.common.event.FMLPreInitializationEvent的用法示例。


在下文中一共展示了FMLPreInitializationEvent.getModConfigurationDirectory方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: preInit

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    FMLCommonHandler.instance().bus().register(this);
    
    //Initialise configs, converting mars.conf + asteroids.conf to planets.conf if necessary
    File oldMarsConf = new File(event.getModConfigurationDirectory(), "Galacticraft/mars.conf");
    File newPlanetsConf = new File(event.getModConfigurationDirectory(), "Galacticraft/planets.conf");
    boolean update = false;
    if (oldMarsConf.exists())
    {
    	oldMarsConf.renameTo(newPlanetsConf);
    	update = true;
    }
    new ConfigManagerMars(newPlanetsConf, update);
    new ConfigManagerAsteroids(new File(event.getModConfigurationDirectory(), "Galacticraft/asteroids.conf"));

    GalacticraftPlanets.commonModules.put(GalacticraftPlanets.MODULE_KEY_MARS, new MarsModule());
    GalacticraftPlanets.commonModules.put(GalacticraftPlanets.MODULE_KEY_ASTEROIDS, new AsteroidsModule());
    GalacticraftPlanets.proxy.preInit(event);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:GalacticraftPlanets.java

示例2: init

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
public static void init(FMLPreInitializationEvent event) {
    directoryPath = event.getModConfigurationDirectory() + "/CustomNEIPlugins/";
    
    // Setting up the main config
    config = new Configuration(new File(directoryPath + "MainSettings.cfg"));
    loadModConfig();
    
    // Setting up the Plugin Folders
    for (String pluginType: PLUGIN_TYPES) {
        File directoryPluginStackInfo = new File(directoryPath + pluginType + "/");
        if (!directoryPluginStackInfo.exists())
            directoryPluginStackInfo.mkdirs();
    }
    
    // Output The Example Plugins
    String[] exampleLocations = {
        "PluginStackInfo/ExamplePluginStackInfo.json",  
        "PluginMachineRecipe/ExamplePluginMachineRecipe1.json",               
        "PluginMachineRecipe/ExamplePluginMachineRecipe2.json"
    };
    for (String exampleLocation: exampleLocations) {
        try {
            File file = new File(directoryPath + exampleLocation);
            if (!file.exists()) {
                PrintWriter printWriter = new PrintWriter(directoryPath + exampleLocation);
                String examplePluginText = Resources.toString(Resources.getResource("assets/" + CustomNEIPlugins.MODID + "/examples/" + exampleLocation), Charsets.UTF_8);
                printWriter.println(examplePluginText);
                printWriter.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
 
開發者ID:GWYOG,項目名稱:CustomNEIPlugins,代碼行數:36,代碼來源:ConfigLoader.java

示例3: PreInit

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void PreInit( FMLPreInitializationEvent pEvent )
{
	Rnd = new Random( System.currentTimeMillis() );
	ELBCfg = new ELBConfig( pEvent.getModConfigurationDirectory(), NICEFOLDERNAME, MODID );
	if (!ELBCfg.LoadConfig())
		Logger.error(String.format("%s could not load its config file. Things are going to be weird!", MODID));
       
	AdminLogonErrors = new IngameErrorLog();
	NW = new ELBDispatcher();
	NW.registerPackets();

	LootGroupHandler = new LootGroupsHandler( pEvent.getModConfigurationDirectory() );
	LootGroupHandler.LoadConfig();
	LootGroupHandler.registerBagItem();

	ELBCreativeTab = new CreativeTabs( "ELBTab" )
	{
		@Override
		@SideOnly( Side.CLIENT )
		public Item getTabIconItem()
		{
			return LootGroupHandler.getLootBagItem();
		}
	};

	LootGroupHandler.getLootBagItem().setCreativeTab( ELBCreativeTab );
}
 
開發者ID:GTNewHorizons,項目名稱:EnhancedLootBags,代碼行數:29,代碼來源:EnhancedLootBags.java

示例4: ICoreModule

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
/**
 * Creates a new 4Space mod module.
 * 
 * @param event The event given on pre init, used to create the configs.
 * @param prefixAsset The asset prefix to use (EX: "spacevenus").
 */
public ICoreModule(FMLPreInitializationEvent event, String prefixAsset) {
	this.prefixAsset = prefixAsset;
	this.prefixTexture = prefixAsset + ":";
	this.configuration = new Configuration(new File(event.getModConfigurationDirectory(), Constants.MOD_NAME + "/" + prefixAsset + ".cfg"));
	
	this.configuration.load();
	loadFromConfig();
	this.configuration.save();
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:16,代碼來源:ICoreModule.java

示例5: preInit

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	BaseDir = new File(event.getModConfigurationDirectory(), Version.MOD_ID);
	Config = new FairyConfig(event.getSuggestedConfigurationFile());

	if (!BaseDir.exists())
		BaseDir.mkdir();

	proxy.preInit();
}
 
開發者ID:allaryin,項目名稱:FairyFactions,代碼行數:11,代碼來源:FairyFactions.java

示例6: preInit

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
	config = new File(evt.getModConfigurationDirectory() + "/PAYDAY.cfg");

	MConfigHandler.init();
}
 
開發者ID:TominoCZ,項目名稱:PAYDAY,代碼行數:7,代碼來源:PAYDAY.java

示例7: preInit

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	CONFIG_DIR = new File(event.getModConfigurationDirectory(), "ProjectE");
	proxy.preInit(event);
}
 
開發者ID:solidDoWant,項目名稱:ExtraE,代碼行數:7,代碼來源:ExtraECore.java

示例8: preInit

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	event.getModConfigurationDirectory();
	event.getModConfigurationDirectory();
	event.getModLog();
	event.getModMetadata();
	event.getModState();
	event.getSide();
	event.getVersionProperties();
	
	
	config.load();
	config.getLoadedConfigVersion();
	
	
	CUSTOM_HAMMER_1 = config.get(CATEGORY_CUSTOM_HAMMERS, "Enable Custom Hammer 1", false).getBoolean(false);
	CUSTOM_HAMMER_1_NAME = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Internal Name", "CustomHammer1");
	CUSTOM_HAMMER_1_LANG_NAME = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Name", "Custom Hammer 1");
	CUSTOM_HAMMER_1_TOOLMATERIAL = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Tool Material", "IRON");
	CUSTOM_HAMMER_1_MATERIALMODIFIER = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Material Modifier", 16);
	CUSTOM_HAMMER_1_TEXTURE = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Texture", "hammermod:\\custom\\custom_1");
	CUSTOM_HAMMER_DESC_1 = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Description", "I'm A Custom Hammer");
	CUSTOM_HAMMER_1_CRAFT = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Crafting Recipe", "XXX, NSN, NSN, 'X', Items.ingotIron, 'S', Items.stick");
	CUSTOM_HAMMER_1_ENCHANT_GLINT = config.get(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer 1 Enchantment Effect", false).getBoolean(false);
	
	SMASH_BREAK_SOUND = config.get(CATEGORY_SETTINGS, "HammerCustomBreakSound", false).getBoolean(false);
	TOASTER_BREAK_SOUND = config.get(CATEGORY_SETTINGS, "ToasterCustomBreakSound", true).getBoolean(true);
	RANDOM_TOAST = config.get(CATEGORY_SETTINGS, "RandomToast", false).getBoolean(false);
	SHARP_TOAST = config.get(CATEGORY_SETTINGS, "SharpToast", false).getBoolean(false);
	DEBUG_MODE  = config.get(CATEGORY_SETTINGS, "DebugMode", false).getBoolean(false);
	
	//config.addCustomCategoryComment(CATEGORY_INFO, "This Configfile is still [WIP] and may not work properly. ***Some things won't work!");
	config.addCustomCategoryComment(CATEGORY_CUSTOM_HAMMERS, "Custom Hammer Settings");
	config.addCustomCategoryComment(CATEGORY_SETTINGS, "Settings");
	//config.getCategoryNames();
		
	config.save();
	
	event.getModLog();
	event.getModState();
	//Configuration configFile = new Configuration(event.getSuggestedConfigurationFile());
	
	//loadConfiguration(configFile);
	
	System.out.println(MODID + " >>> Configuration File Loaded");
	
	
	ModRegistry.registerMods();
	PlayerChecker.checkPlayer(username);
}
 
開發者ID:jtrent238,項目名稱:Hammer-Mod,代碼行數:54,代碼來源:HammerMod.java

示例9: Locations

import cpw.mods.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
public Locations(final FMLPreInitializationEvent event) {
	this.cfgDir = event.getModConfigurationDirectory();
	this.modCfgDir = new File(event.getModConfigurationDirectory(), Reference.MODID);
	this.modFile = event.getSourceFile();
}
 
開發者ID:Team-Fruit,項目名稱:EEWReciever,代碼行數:6,代碼來源:Locations.java


注:本文中的cpw.mods.fml.common.event.FMLPreInitializationEvent.getModConfigurationDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。