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


Java PreInit类代码示例

本文整理汇总了Java中cpw.mods.fml.common.Mod.PreInit的典型用法代码示例。如果您正苦于以下问题:Java PreInit类的具体用法?Java PreInit怎么用?Java PreInit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    apLogger.setParent(FMLLog.getLogger());

    apLogger.info("[Apocalyptic] Starting pre-initialization");
    apLogger.info("[Apocalyptic] Loading configuration");

    isServer = event.getSide().isServer();

    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    tePerChunk = config.get("general", "TileEntitiesPerChunk", 900).getInt(900);
    silverfishChance = config.get("general", "SilverfishSpawnChance", 0.001).getDouble(0.001);
    transferLimit = config.get("transfer", "limit", new String[]{"0:0:0", "1:X:1"}).getStringList();
    transferTagRemove = config.get("transfer", "tag-remove", new String[]{"0:0", "1:X"}).getStringList();
    //databaseURL = config.get("database", "URL", "jdbc:mysql://site.ru:3306/database").getString();
    //databaseUsername = config.get("database", "Username", "Username").getString();
    //databasePassword = config.get("database", "Password", "Password").getString();

    config.load();
    config.save();
    
    this.initCustomPotions(event);

    apLogger.info("[Apocalyptic] Pre-initialization completed");
}
 
开发者ID:kunik-ru,项目名称:Apocalyptic,代码行数:27,代码来源:Apocalyptic.java

示例2: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
	logger = Logger.getLogger(ID);
	logger.setParent(FMLLog.getLogger());

	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	post_url = config.get(config.CATEGORY_GENERAL, "post_url", "http://localhost/post/", "This is the url of which the mod posts updates to.").value;
	identifier = config.get(config.CATEGORY_GENERAL, "identifier", "knownplayers", "This string determines the value of the id field in the post request.").value;
	debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false, "Enable debuging?").getBoolean(true);

	event_login = config.get("event", "login", true, "Send POST on player login?").getBoolean(true);
	event_logout = config.get("event", "logout", true, "Send POST on player logout?").getBoolean(true);
	event_respawn = config.get("event", "respawn", true, "Send POST on player respawn?").getBoolean(true);
	event_changedimension = config.get("event", "changedimension", true, "Send POST when player changes world?").getBoolean(true);

	config.save();

	logger.info("debug: " + debug);
	logger.info("identifier: " + identifier);
	logger.info("post_url: " + post_url);
	logger.info("event_login: " + event_login);
	logger.info("event_logout: " + event_logout);
	logger.info("event_respawn: " + event_respawn);
	logger.info("event_changedimension: " + event_changedimension);
}
 
开发者ID:oddstr13,项目名称:UrbanCraft-KnownPlayers,代码行数:27,代码来源:KnownPlayers.java

示例3: preLoad

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preLoad(FMLPreInitializationEvent event) {
	NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
	
	Configuration conf = new Configuration(
			new File(Loader.instance().getConfigDir(), "OilCraft.cfg"));
	
	conf.load();

	OilGenerator.makeInstance(
			conf.get("blocks", "Oil_Generator", 500).getInt(), 0);
	int stillId = conf.get("blocks", "Oil_Still", 601).getInt();
	OilStill.makeInstance(stillId, 7);
	// Minecraft makes the silly assumption that the block Id of the flow
	// version of a liquid is 1 less than the still version of that same
	// liquid. In this way it can build a connection between the two blocks
	// so they can spawn each other.
	OilFlow.makeInstance(stillId - 1, 7);

	conf.save();

	proxy.preInit();
}
 
开发者ID:lirelent,项目名称:Oilcraft,代码行数:24,代码来源:Oilcraft.java

示例4: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event){
	
	// super Log Helper init for LEDLights
	LogHelper.init();
	
	// Load config to get our IDs and so
	ConfigHandler.init(event.getSuggestedConfigurationFile());
	
	// Loading blocks
	ModBlocks.init();
	ModItems.init();
	
	ModCrafting.init();
	
	ClientProxy.setCustomRenderers();
}
 
开发者ID:SiDzej,项目名称:LEDLights,代码行数:18,代码来源:LEDLights.java

示例5: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    // Register the Sound Handler (Client only)
    MinecraftForge.EVENT_BUS.register(new SoundHandler());
    // Initialize the log helper
    LogHelper.init();
    // Initialize the Blocks and Items
    BlockHelper.init();
    ItemHelper.init();
    // Initialize the Recipes and Dungeon loot
    RecipeHelper.init();
    LootHelper.init();
    // Register the OreGenerator
    GameRegistry.registerWorldGenerator(new OreWorldGeneratorEnd());
    GameRegistry.registerWorldGenerator(new OreWorldGeneratorOverWorld());
    GameRegistry.registerWorldGenerator(new OreWorldGeneratorNether());
    // Initialize the CapeHelper
    CapeHelper.init();
    // Initialize the Entitys
    EntityHelper.init();
   
    // Set the name for the creative tab
    LanguageRegistry.instance().addStringLocalization("itemGroup." + Reference.MOD_ID, "Mythical Gods Mod");
}
 
开发者ID:TAMmodding,项目名称:Mythical-Gods-Mod,代码行数:25,代码来源:MythicalGods.java

示例6: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {

    PaleoPacketHandler.registerChannel();
    proxy.registerRenders();
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()
            + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID
            + ".cfg"));
    LocalizationHandler.loadLanguages();
    ModItem.init();
    ModBlock.init();
    
    proxy.PreInitRenders();
    WorkTableCogHelper.initRecipes();
    MixingTableHelper.initRecipes();
    ModLoaded.PreInit_modloaded();

}
 
开发者ID:Cyntain,项目名称:Fuelsmod,代码行数:19,代码来源:FuelsMod.java

示例7: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
	// TODO: Read configuration files for blocks and items
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	
	config.load();
	
	//someConfigFlag = Boolean.parseBoolean(config.get(ConfigCategory_Generic, "someConfig", "true").value);
	config.addCustomCategoryComment(ConfigCategory_Generic, "All generic settings for questcraft");
	Property someConfig = config.get(ConfigCategory_Generic, "someConfig", "true");
	someConfig.comment = "Configure some configuration setting (true/false). Default true";
	someConfigFlag = someConfig.getBoolean(true);

	Property questInstanceItemIDProperty = config.get(ConfigCategory_Generic, "quest-instance-item-id", "5000");
	questInstanceItemIDProperty.comment = "Item ID used for quest instance items";
	questInstanceItemID = questInstanceItemIDProperty.getInt(5000);

	config.save();
}
 
开发者ID:mbrx,项目名称:QuestCraft,代码行数:20,代码来源:QuestCraft.java

示例8: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
	// Initialize localization
	LocalizationHandler.loadLanguages();

	// Initialize the configuration file
	ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));

	// Initialize WorldGen
	GameRegistry.registerWorldGenerator(new WorldGeneratorEI());
	
	ModBlocks.init(); // Initialize blocks
	ModItems.init();  // Initialize items
	ModOres.init();   // Initialize ores
	ModBiomes.init(); // Initialize Biomes
	ModWorlds.init(); // Initialize Dimension
	ModRecipes.init(); //initialize recipes
}
 
开发者ID:ChistaMisuto,项目名称:Eldritch-Infusion,代码行数:19,代码来源:EI.java

示例9: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
/**
 * This is were you load up blocks/items
 * 
 * @param event
 */
@PreInit
public void preInit(FMLPreInitializationEvent event) {

	log(Level.INFO, "PreInitializing " + Reference.MOD_ID + " version: " + meta.version);

	LocalizationHandler.loadLanguages();

	// Initialize the configuration
	ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator
			+ Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));

	ModBlocks.init();
	ModItems.init();
	ModContent.init();

	GameRegistry.registerWorldGenerator(genManager);

	NetworkRegistry.instance().registerGuiHandler(this, proxy);
}
 
开发者ID:VitezKolya,项目名称:AltEnergy,代码行数:25,代码来源:AltEnergy.java

示例10: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    LocalizationHandler.loadLanguages();
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
            .getAbsolutePath()
            + File.separator
            + Reference.CHANNEL_NAME
            + File.separator + Reference.MOD_ID + ".cfg"));
    // Initialize mod blocks
    ModBlocks.init();

    // Initialize mod items
    ModItems.init();
    
    GameRegistry.registerWorldGenerator(new OreGenerator());
}
 
开发者ID:PaleoCrafter,项目名称:paleocraft,代码行数:17,代码来源:PaleoCraft.java

示例11: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent ev) {
	AmitLogger.info("PreInit");
	File file = ev.getSuggestedConfigurationFile();
	Amitcraft.config = new AmitConfig(file);
	AmitLogger.info("%s file %s", file.exists() ? "Loaded" : "Created", file.getName());

	Amitcraft.config.load();
	for (IDelegate d : this.delegates)
		d.getIds(Amitcraft.config);
	Amitcraft.config.save();

	GameRegistry.registerPlayerTracker(new UpdateNotifier());
	NetworkRegistry.instance().registerGuiHandler(Amitcraft.instance, new GuiHandler());
	MinecraftForge.EVENT_BUS.register(new SoundHandler());
}
 
开发者ID:DrDew2,项目名称:Amitcraft,代码行数:17,代码来源:Amitcraft.java

示例12: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	boolean checkForDatabaseUpdates = config.get("general", "Check for database updates", true).getBoolean(true);
	modDirectory = new File(event.getModConfigurationDirectory().getParent());
	if (!DBHelper.has(checkForDatabaseUpdates)) {
		throw new RuntimeException("Can not start Pixelmon without SQLite jar or database!!! Please reinstall!!");
	}
	if (Loader.isModLoaded("Pokemobs"))
		System.exit(1);

	event.getModMetadata().version = "2.2";

	MaemeConfig.loadConfig(config);
}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:17,代码来源:Maeme.java

示例13: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
  public void preInit(FMLPreInitializationEvent event) {
  	//load the last good configuration
  	config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
  	readConfig();
  }
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:8,代码来源:ShoulderSurfing.java

示例14: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
	logger = Logger.getLogger(ID);
	logger.setParent(FMLLog.getLogger());

	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	// post_url = config.get(config.CATEGORY_GENERAL, "post_url",
	// "http://localhost/post/",
	// "This is the url of which the mod posts updates to.").value;
	identifier = config.get(config.CATEGORY_GENERAL, "identifier", "commandforwarder", "This string determines the value of the id field in the post request.").value;
	debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false, "Enable debuging?").getBoolean(true);

	ConfigCategory cmdcat = config.getCategory("commands");
	cmdcat.setComment("This is a list of command=url.");
	Map<String, Property> cmdmap = cmdcat.getValues();

	if (cmdmap.isEmpty()) {
		config.get("commands", "example", "http://localhost/post/");
	}
	for (Map.Entry i : cmdmap.entrySet()) {
		String k = (String) i.getKey();
		Property v = (Property) i.getValue();
		Command cmd = new Command(k, v.value);
		this.commands.add(cmd);
	}
	// public Map<String,Property> getValues()

	config.save();

	logger.info("debug: " + debug);
	logger.info("identifier: " + identifier);
	// logger.info("post_url: " + post_url);
}
 
开发者ID:oddstr13,项目名称:UrbanCraft-CommandForwarder,代码行数:35,代码来源:CommandForwarder.java

示例15: preInit

import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    LogHelper.init();
    LocalizationHandler.loadLanguages();
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
            .getAbsolutePath()
            + File.separator
            + Reference.CHANNEL_NAME
            + File.separator + Reference.MOD_ID + ".cfg"));
    ModBlocks.init();
    ModItems.init();
}
 
开发者ID:jarthur36,项目名称:MMOMats,代码行数:13,代码来源:MMOMats.java


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