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


Java Property.getInt方法代码示例

本文整理汇总了Java中net.minecraftforge.common.Property.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getInt方法的具体用法?Java Property.getInt怎么用?Java Property.getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.Property的用法示例。


在下文中一共展示了Property.getInt方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preInit

import net.minecraftforge.common.Property; //导入方法依赖的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

示例2: preInit

import net.minecraftforge.common.Property; //导入方法依赖的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

示例3: preInit

import net.minecraftforge.common.Property; //导入方法依赖的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

示例4: preInit

import net.minecraftforge.common.Property; //导入方法依赖的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

示例5: init

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
public static void init(CellariumConfiguration main)
{
	
	Property bloodHelmetId = main.getItem("bloodHelmet.id", DefaultProps.BLOOD_HELMET);
	Property bloodChestId = main.getItem("bloodChest.id", DefaultProps.BLOOD_CHEST);
	Property bloodPantsId = main.getItem("bloodPants.id", DefaultProps.BLOOD_PANTS);
	Property bloodBootsId = main.getItem("bloodBoots.id", DefaultProps.BLOOD_BOOTS);
	
	bloodHelmet = new BloodArmor(bloodHelmetId.getInt(), bloodMaterial, Cellarium.proxy.addArmor("blood"), 0, "bloodHelmet", "blood");
	bloodChest = new BloodArmor(bloodChestId.getInt(), bloodMaterial, Cellarium.proxy.addArmor("blood"), 1, "bloodChest", "blood");
	bloodPants = new BloodArmor(bloodPantsId.getInt(), bloodMaterial, Cellarium.proxy.addArmor("blood"), 2, "bloodPants", "blood");
	bloodBoots = new BloodArmor(bloodBootsId.getInt(), bloodMaterial, Cellarium.proxy.addArmor("blood"), 3, "bloodBoots", "blood");
	
	Property tearsHelmetId = main.getItem("tearsHelmet.id", DefaultProps.TEARS_HELMET);
	Property tearsChestId = main.getItem("tearsChest.id", DefaultProps.TEARS_CHEST);
	Property tearsPantsId = main.getItem("tearsPants.id", DefaultProps.TEARS_PANTS);
	Property tearsBootsId = main.getItem("tearsBoots.id", DefaultProps.TEARS_BOOTS);
	
	tearsHelmet = new TearsArmor(tearsHelmetId.getInt(),tearsMaterial, Cellarium.proxy.addArmor("tears"), 0, "tearsHelmet", "tears");
	tearsChest = new TearsArmor(tearsChestId.getInt(),tearsMaterial, Cellarium.proxy.addArmor("tears"), 1, "tearsChest", "tears");
	tearsPants = new TearsArmor(tearsPantsId.getInt(),tearsMaterial, Cellarium.proxy.addArmor("tears"), 2, "tearsPants", "tears");
	tearsBoots = new TearsArmor(tearsBootsId.getInt(),tearsMaterial, Cellarium.proxy.addArmor("tears"), 3, "tearsBoots", "tears");
	
}
 
开发者ID:mrgregfinch,项目名称:powell.cellarium,代码行数:25,代码来源:Armors.java

示例6: loadItemsFromConfig

import net.minecraftforge.common.Property; //导入方法依赖的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

示例7: preInit

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit( FMLPreInitializationEvent event )
{
	// Load config
	Configuration config = new Configuration( event.getSuggestedConfigurationFile() );
	config.load();
	
	// Setup blocks
	Property prop = config.getBlock("billundBlockID", 2642);
	prop.comment = "The Block ID for Billund Blocks";
	billundBlockID = prop.getInt();

	// Setup items
	prop = config.getItem("brickItemID", 6242);
	prop.comment = "The Item ID for Billund Bricks";
	brickItemID = prop.getInt();
	
	prop = config.getItem("orderFormItemID", 6242);
	prop.comment = "The Item ID for Billund order forms";
	orderFormItemID = prop.getInt();
	
	// Setup general
	// None
	
	// Save config
	config.save();
	
	proxy.preLoad();
}
 
开发者ID:dan200,项目名称:Billund,代码行数:30,代码来源:Billund.java

示例8: preInit

import net.minecraftforge.common.Property; //导入方法依赖的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

示例9: loadConfiguration

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
public void loadConfiguration()
{
    config.load();
    Property blockEngineId = config.get("block", "electricEngine", 765);
    Property blockPneumaticGeneratorId = config.get("block", "pneumaticGenerator", 766);
    Property itemHighThroughputPowerPipe = config.get("item", "highThroughputPowerPipe", 22552);
    Property gregtechRecipes = config.get("recipes", "gregtechRecipes", true);
    engineId = blockEngineId.getInt();
    pneumaticGeneratorId = blockPneumaticGeneratorId.getInt();
    highThroughputPowerPipeId = itemHighThroughputPowerPipe.getInt();
    gregtechSupport = gregtechRecipes.getBoolean(true);
    config.save();
}
 
开发者ID:adamros,项目名称:Transducers,代码行数:14,代码来源:Config.java

示例10: init

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
public static void init(CellariumConfiguration main)
{
	Property reaperHiltId = main.getItem("reaperHilt.id", DefaultProps.REAPER_HILT);		
	reaperHilt = new ReaperHilt(reaperHiltId.getInt());
	
	Property reaperBladeId = main.getItem("repaerBlade.id", DefaultProps.REAPER_BLADE);
	reaperBlade = new ReaperBlade(reaperBladeId.getInt());
	
	Property theReaperId = main.getItem("theReaper.id", DefaultProps.THE_REAPER);
	theReaper = new TheReaper(theReaperId.getInt());
	
	Property sorrowfelHiltId = main.getItem("sorrowfelHilt.id", DefaultProps.SORROWFEL_HILT);		
	sorrowfelHilt = new SorrowfelHilt(sorrowfelHiltId.getInt());
	
	Property sorrowfelBladeId = main.getItem("sorrowfelBlade.id", DefaultProps.SORROWFEL_BLADE);
	sorrowfelBlade = new SorrowfelBlade(sorrowfelBladeId.getInt());
	
	Property sorrowfelId = main.getItem("sorrowfel.id", DefaultProps.SORROWFEL);
	sorrowfel = new Sorrowfel(sorrowfelId.getInt());
	
	Property bloodAndSorrowId = main.getItem("bloodAndSorrow.id", DefaultProps.BLOOD_AND_SORROW);
	bloodAndSorrow = new BloodAndSorrow(bloodAndSorrowId.getInt());
	
	Property ingotFrameId = main.getItem("ingotFrame.id", DefaultProps.INGOT_FRAME);
	ingotFrame = new IngotFrame(ingotFrameId.getInt());
	
	Property tearsIngotId = main.getItem("tearsIngot.id", DefaultProps.TEARS_INGOT);
	tearsIngot = new TearsIngot(tearsIngotId.getInt());
}
 
开发者ID:mrgregfinch,项目名称:powell.cellarium,代码行数:30,代码来源:Items.java

示例11: ConfigHandler

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
public ConfigHandler(File configFile){
	// Loads The Configuration File into Forges Configuration
	Configuration conf = new Configuration(configFile);
	try{
		conf.load();
		
		// Misc mod settings
		Property IdeaChanceRate = conf.get("Settings", "IdeaRate", 35);
		IdeaChanceRate.comment = "The chance of you getting an idea from crafting (fx. 1 in a 100)";
		ideaChance = IdeaChanceRate.getInt();
		
		Property GenOreTin = conf.get("Settings", "GenOreTin", true);
		GenOreTin.comment = "Should the mod generate tin";
           genOreTin = GenOreTin.getBoolean(true);
		
           Property GenOreCopper = conf.get("Settings", "GenOreCopper", true);
           GenOreCopper.comment = "Should the mod generate copper";
           genOreCopper = GenOreCopper.getBoolean(true);
           
		// Load Block Ids
		
		Property blockOre = conf.getBlock("OreBlocks", blockRange);
		blockOre.comment = "Ore Block ID, this includes Tin, Copper and Others";
		IDOreBlock = blockOre.getInt();
		
		Property blockWorkstation = conf.getBlock("Workstation", blockRange+1);
		blockWorkstation.comment = "The workstation where you refine your ideas and craft items";
		IDWorkstation = blockWorkstation.getInt();
		
		Property blockIdeaBuilder = conf.getBlock("IdeaBuilder", blockRange+2);
		blockIdeaBuilder.comment = "This is the extension too the workstation that lets you craft what you think off.";
           IDIdeaBuilder = blockIdeaBuilder.getInt();
           
           Property blockCraftingTable = conf.getBlock("CraftingTable", blockRange+3);
           blockCraftingTable.comment = "This is a vanilla crafting table extention too the workstation, will keep inventory on gui close !";
           IDCraftingTable = blockCraftingTable.getInt();
           
           Property blockIdeaBlocks = conf.getBlock("IdeaBlocks", blockRange+4);
           blockIdeaBlocks.comment = "These are the blocks you can build from your ideas";
           IDIdeaBlocks = blockIdeaBlocks.getInt();
		
		// Load Item Ids
		
		Property itemIdea = conf.getItem("Idea", itemRange);
		itemIdea.comment = "The idea paper that falls on the ground";
		IDIdeaItem = itemIdea.getInt();
		
		Property itemBookOfWondering = conf.getItem("BookOfWondering", itemRange+1);
		itemBookOfWondering.comment = "The Book of Wondering, for you too store your ideas";
		IDWonderingBook = itemBookOfWondering.getInt();
		
		Property itemPencil = conf.getItem("Pencil", itemRange+2);
		itemPencil.comment = "Pencil is an idea you have for editing signs";
           IDPencil = itemPencil.getInt();
           
           Property itemResource = conf.getItem("ItemResources", itemRange+3);
           itemResource.comment = "Item resources like copper and tin ingots";
           IDResource = itemResource.getInt();
           
           Property itemMinersHelm = conf.getItem("MinersHelmet", itemRange+4);
           itemMinersHelm.comment = "Helmet you put on for minging";
           IDMinersHelmet = itemMinersHelm.getInt();
		
	}catch(RuntimeException e){
		MineTechPlus.instance.log.log(Level.INFO, "Config file not found, creating new one");
	}finally{
		conf.save();
	}
}
 
开发者ID:aronthor,项目名称:MineTech,代码行数:70,代码来源:ConfigHandler.java

示例12: load

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
@Init
public void load(FMLInitializationEvent event) {
	proxy.registerRenderers();

	config.load();

	config.addCustomCategoryComment(ConfigCategory_Generic,
			"All generic settings for questcraft");
	config.addCustomCategoryComment(
			ConfigCategory_Blocks,
			"Rules for all blocks that should be affected by this.\n"
					+ "All rules have a name of Bi_xyz where i is an integer counting up from 0.\n"
					+ "Each rule has to have a name _Name (eg. B42_Name) that is a regular expression for matching blocks to the rule.\n"
					+ "Additional information for the rules include any of the following:\n"
					+ "  _MetaData: overrides the metadata to give to the block when it pops\n"
					+ "  _StackSize: overrides the maximum allowed stacksize for blockitems matching the rule\n");
	

	Property defaultMetaDataProp = config.get(ConfigCategory_Generic,
			"defaultMetaData", "-1");
	defaultMetaDataProp.comment = "The meta value to assign blocks that a placed back in world."
			+ "Default -1 uses the same as from the given item ID."
			+ "255 is needed for blocks with dual states in the BlockPhysics mod";
	defaultMetaData = defaultMetaDataProp.getInt(-1);

	Property printBlockItemInfoProp = config.get(ConfigCategory_Generic,
			"printBlockInfo", "false");
	printBlockItemInfoProp.comment = "Print a chat message whenver a blockitem is picked up with the corresponding name of the block used for making rules. Default false";
	printBlockItemInfo = printBlockItemInfoProp.getBoolean(false);

	Property defaultStackSizeProp = config.get(ConfigCategory_Generic,
			"defaultStackSize", "1");
	defaultStackSizeProp.comment = "The default maximum size of any of the stacks that are listen in the blocks section, may be overridden for individual blocks";
	defaultStackSize = defaultStackSizeProp.getInt(1);

	Property defaultMinPopTimeProp = config.get(ConfigCategory_Generic,
			"defaultMinPopTime", "20");
	defaultMinPopTimeProp.comment = "The default minimum time (in ticks) before an itemstack matched by the rules will pop-out to become a block";
	defaultMinPopTime = defaultMinPopTimeProp.getInt(20);

	Property defaultMaxPopTimeProp = config.get(ConfigCategory_Generic,
			"defaultMaxPopTime", "20");
	defaultMaxPopTimeProp.comment = "The default minimum time (in ticks) before an itemstack matched by the rules will pop-out to become a block";
	defaultMaxPopTime = defaultMaxPopTimeProp.getInt(20);

	for(nRules=0;nRules<256;) {
		Property nameProp = config.get(ConfigCategory_Blocks, "B"
				+ nRules + "_Name", "");
		Property metaDataProp = config.get(ConfigCategory_Blocks, "B"
				+ nRules + "_MetaData", "");
		Property stackSizeProp = config.get(ConfigCategory_Blocks, "B"
				+ nRules  + "_MaxStackSize", "");
		Property minPopTimeProp = config.get(ConfigCategory_Blocks, "B"
				+ nRules + "_MinPopTime", "");
		Property maxPopTimeProp = config.get(ConfigCategory_Blocks, "B"
				+ nRules + "_MaxPopTime", "");

		if (nameProp == null || nameProp.value.equals(""))
			break;
		
		Rule r = new Rule();
		r.blockName = nameProp.value;
		if(metaDataProp.value == "") r.metaData = -2;
		else r.metaData = metaDataProp.getInt(-2);
		if(stackSizeProp.value == "") r.stackSize = -2;
		else r.stackSize = stackSizeProp.getInt(-2);
		if(minPopTimeProp.value == "") r.minPopTime = -2;
		else r.minPopTime = minPopTimeProp.getInt(-2);
		if(maxPopTimeProp.value == "") r.maxPopTime = -2;
		else r.maxPopTime = maxPopTimeProp.getInt(-2);
		rules[nRules++] = r;
	}

	System.out.println("Finished loading settings, "+nRules+" rules found");
	config.save();

	eventListener = new EventListener();
	MinecraftForge.EVENT_BUS.register(eventListener);		
}
 
开发者ID:mbrx,项目名称:PilesOfBlocks,代码行数:80,代码来源:PilesOfBlocks.java

示例13: ConfigHandler

import net.minecraftforge.common.Property; //导入方法依赖的package包/类
public ConfigHandler(File configFile){
// Loads The Configuration File into Forges Configuration
Configuration conf = new Configuration(configFile);
try{
conf.load();




Property GenOreTin = conf.get("Settings", "GenOreTin", true);
GenOreTin.comment = "Should the mod generate tin";
            genOreTin = GenOreTin.getBoolean(true);

            Property GenOreCopper = conf.get("Settings", "GenOreCopper", true);
            GenOreCopper.comment = "Should the mod generate copper";
            genOreCopper = GenOreCopper.getBoolean(true);
            


Property blockOre = conf.getBlock("OreBlocks", blockRange);
blockOre.comment = "Ore Block ID(Tin, Copper and Others)";
IDOreBlock = blockOre.getInt();





Property itemBlasterRifle = conf.getItem("BlasterRifle", itemRange);
itemBlasterRifle.comment = "Grosse Waffe^";
IDBlasterRifle = itemBlasterRifle.getInt();

Property itemRedstoneBattery = conf.getItem("RedstoneBattery", itemRange+1);
itemRedstoneBattery.comment = "Magazin fuer Waffe";
IDRedstoneBattery = itemRedstoneBattery.getInt();


            
            Property itemResource = conf.getItem("ItemResources", itemRange+3);
            itemResource.comment = "copper and tin ingots";
            IDResource = itemResource.getInt();
            


}catch(RuntimeException e){
MOF.instance.log.log(Level.INFO, "Config file not found, creating new one");
}finally{
conf.save();
}
}
 
开发者ID:fipsi7,项目名称:Minecraft_on_Fire,代码行数:50,代码来源:ConfigHandler.java


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