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