本文整理汇总了Java中net.minecraftforge.common.Configuration.getItem方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getItem方法的具体用法?Java Configuration.getItem怎么用?Java Configuration.getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.Configuration
的用法示例。
在下文中一共展示了Configuration.getItem方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的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();
}
示例2: loadCommonConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void loadCommonConfig(FMLPreInitializationEvent evt)
{
Configuration c = new Configuration(evt.getSuggestedConfigurationFile());
try {
c.load();
makeshiftBatteryId = c.getBlock("ID.MakeshiftBattery", 2400);
conductanceCoilId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ConductanceCoil", 23200);
makeshiftUpgradeId = c.getItem(Configuration.CATEGORY_ITEM, "ID.MakeshiftUpgrade", 23201);
} catch (Exception e) {
e.printStackTrace();
} finally {
c.save();
}
}
示例3: 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();
}
}
示例4: loadConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void loadConfig(File configFile)
{
Configuration c = new Configuration(configFile);
thaumiumShearsItemId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThaumiumShears", 26430);
thaumiumFishingPoleItemId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThaumiumFishingPole", 26431);
thaumiumRodItemId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThaumiumRod", 26432);
thaumiumPoleandCarrotItemId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThaumiumPoleandCarrot", 26433);
infusedFishingPoleItemId = c.getItem(Configuration.CATEGORY_ITEM, "ID.InfusedFishingPole", 26434);
c.save();
}
示例5: ConfigHandler
import net.minecraftforge.common.Configuration; //导入方法依赖的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();
}
}
示例6: ConfigHandler
import net.minecraftforge.common.Configuration; //导入方法依赖的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();
}
}