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


Java Configuration.get方法代碼示例

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


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

示例1: buildBlacklist

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
public static void buildBlacklist(Configuration config) {
	config.addCustomCategoryComment(
			"ITEM_BLACKLIST",
			"Add here the blacklisted items (set them to true).\n"
					+ "'item.' signifies an item, 'tile.' signifies a block.\n"
					+ "Everytime this is changed, you probably should delete the price file.\n"
					+ "(although this is not necessary.)");
	Property configProperty;
	for (int i = 0; i < Item.itemsList.length; i++) {
		if (Item.itemsList[i] == null)
			continue;
		Boolean isBlackListed = false;
		if (defBlacklist != null){
			isBlackListed = defBlacklist.get(Item.itemsList[i].itemID);
			if (isBlackListed == null){
				isBlackListed = false;
			}
		}
		configProperty = config.get("ITEM_BLACKLIST",
				Item.itemsList[i].getUnlocalizedName(), isBlackListed);
		if (configProperty.getBoolean(false)) {
			addItemToBlacklist(Item.itemsList[i]);
		}
	}
}
 
開發者ID:TED-996,項目名稱:UniversalCoinsMod,代碼行數:26,代碼來源:UCItemPricer.java

示例2: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的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: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());
    config.load();
    
    Property updateI = config.get(Configuration.CATEGORY_GENERAL, "update Interval", 1000);
    updateI.comment = "Update Interval time for all EntityLiving in milliseconds. The lower the better and costlier.";
    updateInterval = updateI.getInt();
    
    itemsMap = new HashMap<Integer, Integer>();
    Property itemsList = config.get(Configuration.CATEGORY_GENERAL, "LightItems", "50:15,89:12,348:10,91:15,327:15,76:10,331:10,314:14");
    itemsList.comment = "Item and Armor IDs that shine light when found on any EntityLiving. Syntax: ItemID:LightValue, seperated by commas";
    String[] tokens = itemsList.getString().split(",");
    for (String pair : tokens)
    {
        String[] values = pair.split(":");
        int id = Integer.valueOf(values[0]);
        int value = Integer.valueOf(values[1]);
        itemsMap.put(id, value);
    }
    
    config.save();
}
 
開發者ID:liosha2007,項目名稱:minecraft-dynamic-lights,代碼行數:25,代碼來源:EntityLivingEquipmentLightSource.java

示例4: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());
    config.load();
    
    Property itemsList = config.get(Configuration.CATEGORY_GENERAL, "LightItems", "50,89=12,348=10,91,327,76=10,331=10,314=14");
    itemsList.comment = "Item IDs that shine light while held. Armor Items also work when worn. [ONLY ON OTHERS] Syntax: ItemID[-MetaValue]:LightValue, seperated by commas";
    itemsMap = new ItemConfigHelper(itemsList.getString(), 15);
    
    Property updateI = config.get(Configuration.CATEGORY_GENERAL, "update Interval", 1000);
    updateI.comment = "Update Interval time for all other player entities in milliseconds. The lower the better and costlier.";
    updateInterval = updateI.getInt();
    
    config.save();
}
 
開發者ID:liosha2007,項目名稱:minecraft-dynamic-lights,代碼行數:17,代碼來源:PlayerOthersLightSource.java

示例5: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());
    config.load();
    
    Property itemsList = config.get(Configuration.CATEGORY_GENERAL, "LightItems", "50,89=12,348=10,91,327,76=10,331=10,314=14");
    itemsList.comment = "Item IDs that shine light when dropped in the World.";
    itemsMap = new ItemConfigHelper(itemsList.getString(), 15);
    
    Property updateI = config.get(Configuration.CATEGORY_GENERAL, "update Interval", 1000);
    updateI.comment = "Update Interval time for all Item entities in milliseconds. The lower the better and costlier.";
    updateInterval = updateI.getInt();
    
    Property notWaterProofList = config.get(Configuration.CATEGORY_GENERAL, "TurnedOffByWaterItems", "50,327");
    notWaterProofList.comment = "Item IDs that do not shine light when dropped and in water, have to be present in LightItems.";
    notWaterProofItems = new ItemConfigHelper(notWaterProofList.getString(), 1);
    
    config.save();
}
 
開發者ID:liosha2007,項目名稱:minecraft-dynamic-lights,代碼行數:21,代碼來源:DroppedItemsLightSource.java

示例6: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());
    config.load();
    
    Property itemsList = config.get(Configuration.CATEGORY_GENERAL, "LightItems", "50,89=12,348=10,91,327,76=10,331=10,314=14");
    itemsList.comment = "Item IDs that shine light while held. Armor Items also work when worn. [ONLY ON YOURSELF]";
    itemsMap = new ItemConfigHelper(itemsList.getString(), 15);
    
    Property notWaterProofList = config.get(Configuration.CATEGORY_GENERAL, "TurnedOffByWaterItems", "50,327");
    notWaterProofList.comment = "Item IDs that do not shine light when held in water, have to be present in LightItems.";
    notWaterProofItems = new ItemConfigHelper(notWaterProofList.getString(), 1);
    
    config.save();
}
 
開發者ID:liosha2007,項目名稱:minecraft-dynamic-lights,代碼行數:17,代碼來源:PlayerSelfLightSource.java

示例7: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的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: Metrics

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
public Metrics(final String modname, final String modversion) throws IOException
{
    if ((modname == null) || (modversion == null))
    {
        throw new IllegalArgumentException("modname and modversion cannot be null");
    }

    this.modname = modname;
    this.modversion = modversion;

    // load the config
    configurationFile = getConfigFile();
    configuration = new Configuration(configurationFile);

    // Get values, and add some defaults, if needed
    configuration.get(Configuration.CATEGORY_GENERAL, "opt-out", false, "Set to true to disable all reporting");
    guid = configuration.get(Configuration.CATEGORY_GENERAL, "guid", UUID.randomUUID().toString(), "Server unique ID").getString();
    debug = configuration.get(Configuration.CATEGORY_GENERAL, "debug", false, "Set to true for verbose debug").getBoolean(false);
    configuration.save();
}
 
開發者ID:CCM-Modding,項目名稱:Nucleum-Omnium,代碼行數:21,代碼來源:Metrics.java

示例9: loadConfig

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
public static void loadConfig(Configuration config) {
	config.load();
	connectURL = config.get("Web", "ConnectURL", "http://mywebserver.info/php/").getString();
	rate = config.get("Web", "UploadC", false);
	rate.comment = "Upload data by timer/minute(int) or false for logout and itemchange";
	if(rate.getBoolean(false) || rate.getInt() < 0){
		Refrate = 0;
	}
	else{
		Refrate = rate.getInt();
	}
	mkT = config.get("Misc", "maketexture", false);
	mkT.comment = "Enable the texture interceptor? (make a zip after doing /isl makeT ingame)";
	maketexture = mkT.getBoolean(true);
	DEBUG = config.get("Misc", "DEBUG", false).getBoolean(true);
	ChestUP = config.get("Misc", "ChestUP", false);
	ChestUP.comment = "Upload chest contents regardless of signs? (nonfunctional right now)";
	uploadchests = ChestUP.getBoolean(true);
	config.save();
}
 
開發者ID:Banasen,項目名稱:InvScan,代碼行數:21,代碼來源:Config.java

示例10: loadItemsFromConfig

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
public static void loadItemsFromConfig(Configuration config) {
	
	config.addCustomCategoryComment(
			"ITEM_PRICES",
			"Add here the item prices.\n"
					+ "-1 means no price is set.\n"
					+ "'item.' signifies an item, 'tile.' signifies a block.");
	Property configProperty;
	int price;
	for (int i = 0; i < Item.itemsList.length; i++) {
		if (Item.itemsList[i] == null || isBlacklisted(Item.itemsList[i]))
			continue;
		Integer defaultPrice = -1;
		if (defPrices != null){
			defaultPrice = defPrices.get(Item.itemsList[i].itemID);
			if (defaultPrice == null){
				defaultPrice = -1;
			}
		}
		configProperty = config.get("ITEM_PRICES",
				Item.itemsList[i].getUnlocalizedName(), defaultPrice);
		price = configProperty.getInt();
		if (price != -1) {
			addItemToList(Item.itemsList[i], price);
		}
	}
	
}
 
開發者ID:TED-996,項目名稱:UniversalCoinsMod,代碼行數:29,代碼來源:UCItemPricer.java

示例11: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	
	config.load();
	
	acceleratorID = config.getBlock("acceleratorID", 530).getInt();
	launcherID = config.getBlock("launcherID", 531).getInt();
	heartSandID = config.getBlock("heartSandID", 532).getInt();
	gravityInverterID = config.getBlock("gravityInverterID", 533).getInt();
	directionalLauncherID = config.getBlock("directionalLauncherID", 534).getInt();
	gravityWellID = config.getBlock("gravityWellID", 535).getInt();
	pearlActivatorID = config.getBlock("pearlActivatorID", 536).getInt();
	ruggedPearlID = config.getItem("ruggedPearlID", 537).getInt();
	gravityNullifierID = config.getBlock("gravityNullifierID", 538).getInt();
	negatorID = config.getItem("negatorID", 539).getInt();
	detectorID = config.getBlock("detectorID", 540).getInt();
	
	gravityInverterRange = config.get("tweaks", "gravityInverterRange", 8);
	gravityWellRange = config.get("tweaks", "gravityWellRange", 16);
	gravityWellPower = config.get("tweaks", "gravityWellPower", 100);
	detectorRange = config.get("tweaks", "detectorRange", 8);
	
	ruggedPearlLifespan = config.get("tweaks", "ruggedPearlLifespan", 1600);
	airResistanceInNullifier = config.get("tweaks", "airResistanceInNullifier", false);
	
	config.save();
}
 
開發者ID:hexaguin,項目名稱:Advanced-Kinetics,代碼行數:29,代碼來源:AdvancedKinetics.java

示例12: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的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

示例13: initConfig

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
private void initConfig(FMLPreInitializationEvent event)
{
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

    rendererFormat = config.get(Configuration.CATEGORY_GENERAL, ConfigKeys.format.toString(), Format.Interlaced.toString(),
            configComment("sterescopic 3D output format to be used", Format.values()));
    swapSides = config.get(Configuration.CATEGORY_GENERAL, ConfigKeys.swapSides.toString(), false,
            configComment("whether to swap the left and right image", new Boolean[] { true, false })).getBoolean(false);

    if (config.hasChanged()) {
        config.save();
    }
}
 
開發者ID:zsawyer,項目名稱:Stereoscopic3D-for-Minecraft,代碼行數:16,代碼來源:Stereoscopic3D.java

示例14: preInit

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());
    config.load();
    
    Property updateI = config.get(Configuration.CATEGORY_GENERAL, "update Interval", 1000);
    updateI.comment = "Update Interval time for all burning EntityLiving, Arrows and Fireballs in milliseconds. The lower the better and costlier.";
    updateInterval = updateI.getInt();
    
    config.save();
}
 
開發者ID:liosha2007,項目名稱:minecraft-dynamic-lights,代碼行數:13,代碼來源:BurningEntitiesLightSource.java

示例15: loadCommonConfig

import net.minecraftforge.common.Configuration; //導入方法依賴的package包/類
public static void loadCommonConfig(FMLPreInitializationEvent evt)
{
    Configuration c = new Configuration(evt.getSuggestedConfigurationFile());
    try {
        c.load();

        hexbiscus = c.getBlock("ID.HexbiscusFlower", 2400);

        tribalHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalHelmet", 26200);
        tribalChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalChest", 26201);
        tribalLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalLeggings", 26202);
        tribalShoesId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalShoes", 26203);

        scaleHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleHelmet", 26204);
        scaleChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleChest", 26205);
        scaleLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleLeggings", 26206);
        scaleBootsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleBoots", 26207);

        thiefHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefHelmet", 26208);
        thiefChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefChest", 26209);
        thiefLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefLeggings", 26210);
        thiefBootsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefBoots", 26211);

        hexicalEssence = c.getItem(Configuration.CATEGORY_ITEM, "ID.HexicalEssence", 26212);
        hexicalDiamond = c.getItem(Configuration.CATEGORY_ITEM, "ID.HexicalDiamond", 26213);

        dimensionalBlacklist = c.get("World Generation", "Dimensional Blacklist", "");
        dimensionalBlacklist.comment = "Comma separated list of all blacklisted dimension IDs";

    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        c.save();
    }
}
 
開發者ID:sct,項目名稱:HexxitGear,代碼行數:36,代碼來源:HexxitGearConfig.java


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