本文整理汇总了Java中net.minecraftforge.common.Configuration.save方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.save方法的具体用法?Java Configuration.save怎么用?Java Configuration.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.Configuration
的用法示例。
在下文中一共展示了Configuration.save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
/**
* Set the ids in the configs
* @param event
*/
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
config = new Configuration(event.getSuggestedConfigurationFile());
try {
config.load();
bedBlockID = config.getBlock("Guest Bed Block ID", bedBlockID).getInt(2000);
bedItemID = config.getItem("Guest Bed Item ID", bedItemID).getInt(14000);
} catch (Exception e) {
e.printStackTrace();
} finally {
config.save();
}
}
示例2: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(
event.getSuggestedConfigurationFile());
config.load();
itemCoinID = config.getItem("itemCoin", itemCoinID).getInt();
itemSSTackID = config.getItem("itemSmallCoinStack", itemSSTackID).getInt();
itemLStackID = config.getItem("itemLargeCoinStack", itemLStackID).getInt();
itemHeapID = config.getItem("itemCoinHeap", itemHeapID).getInt();
itemSellerID = config.getItem("itemSeller", itemSellerID).getInt();
blockTradeStationID = config.getBlock("blockTradeStation", blockTradeStationID).getInt();
config.save();
}
示例3: loadConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
/**
* Loads configurations from the properties file.<br>
* - Remote item ID: (Remote.ID)<br>
*/
private static void loadConfig() {
Configuration wirelessconfig = ConfigurationLib.getConfig();
wirelessconfig.load();
remoteID = wirelessconfig.get(Configuration.CATEGORY_ITEM,
ItemLib.REMOTE,
remoteID).getInt();
duraTogg = wirelessconfig.get(Configuration.CATEGORY_GENERAL,
"Duration Toggle",
duraTogg).getBoolean(duraTogg);
pulseTime = wirelessconfig.get(Configuration.CATEGORY_GENERAL,
"Pulse Time",
pulseTime).getInt();
maxPulseThreads = wirelessconfig.get(Configuration.CATEGORY_GENERAL,
"Max Threads",
maxPulseThreads).getInt();
wirelessconfig.save();
}
示例4: init
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void init(File file)
{
Configuration config = new Configuration(file);
config.load();
/** Tooltip Sector **/
config.addCustomCategoryComment("Tooltip Options", "These are the options used to control how WikiLink displays tooltips on items when hovering over them in the inventory.");
includeTooltipsOnItems = config.get("Tooltip Options", "includeTooltipsOnItems", true).getBoolean(true);
/** Link Selection Sector **/
config.addCustomCategoryComment("Link Selection", "These are the options used to control the different links that appear inside of the WikiLink Menu.");
enableWiki = config.get("Link Selection", "enableWiki", true).getBoolean(true);
enableGoogle = config.get("Link Selection", "enableGoogle", true).getBoolean(true);
enableThread = config.get("Link Selection", "enableThread", true).getBoolean(true);
enableWebsite = config.get("Link Selection", "enableWebsite", true).getBoolean(true);
enableYoutube = config.get("Link Selection", "enableYoutube", true).getBoolean(true);
enableSummarize = config.get("Link Selection", "enableSummarize", true).getBoolean(true);
/** Link Shortener Sector **/
config.addCustomCategoryComment("Link Shortener Options", "These are the options to change how WikiLink shortens all of it's hyperlinks.");
shortenHyperlinks = config.get("Link Shortener Options", "shortenHyperlinks", true, "Use bit.ly to shorten links generated by WikiLink").getBoolean(true);
debugMode = config.get("Debug Options", "debugMode", false, "Use this during startup/runtime to get your console spammed curtosy of WikiLink :)").getBoolean(false);
config.save();
}
示例5: init
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void init(File configFile)
{
configuration = new Configuration(configFile);
try
{
ItemIds.MODULE = configuration.getItem(Strings.MODULE_BASE_NAME, ItemIds.MODULE_DEFAULT).getInt(ItemIds.MODULE_DEFAULT);
ItemIds.BUDDY = configuration.getItem(Strings.BUDDY_NAME, ItemIds.BUDDY_DEFAULT).getInt(ItemIds.BUDDY_DEFAULT);
ItemIds.CHIPSET = configuration.getItem(Strings.CHIPSET_BASE_NAME, ItemIds.CHIPSET_DEFAULT).getInt(ItemIds.CHIPSET_DEFAULT);
ItemIds.ROBOT = configuration.getItem(Strings.ROBOT_NAME, ItemIds.ROBOT_DEFAULT).getInt(ItemIds.ROBOT_DEFAULT);
BlockIds.FACTORY_CONTROLLER = configuration.getBlock(Strings.FACTORY_CONTROLLER_NAME, BlockIds.FACTORY_CONTROLLER_DEFAULT).getInt(BlockIds.FACTORY_CONTROLLER_DEFAULT);
BlockIds.FACTORY_BASE = configuration.getBlock(Strings.FACTORY_BASE_NAME, BlockIds.FACTORY_BASE_DEFAULT).getInt(BlockIds.FACTORY_BASE_DEFAULT);
BlockIds.FACTORY_ENERGY = configuration.getBlock(Strings.FACTORY_ENERGY_NAME, BlockIds.FACTORY_ENERGY_DEFAULT).getInt(BlockIds.FACTORY_ENERGY_DEFAULT);
} catch (Exception e)
{
FMLLog.log(Level.SEVERE, e, Reference.MOD_NAME
+ " has had a problem loading its configuration");
} finally
{
configuration.save();
}
}
示例6: loadConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void loadConfig(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
teamSelectionId = config.getBlock("teamSelectionBlock", 500).getInt();
unbreakableGlassId = config.getBlock("unbreakableGlass", 501).getInt();
gameMod = config.get(Configuration.CATEGORY_GENERAL, "gameMod", "onlinefreak").getString();
dimensionId = config.get(Configuration.CATEGORY_GENERAL, "dimensionId", 5).getInt();
maxTeams = config.get(Configuration.CATEGORY_GENERAL, "maxTeams", 7).getInt();
pvpPreventionMinutes = config.get(Configuration.CATEGORY_GENERAL, "pvpPreventionMinutes", 30).getInt();
pvpFriendlyFireOn = config.get("PVP", "pvpFriendlyFireOn", false).getBoolean(false);
if (pvpPreventionMinutes < 0)
pvpPreventionMinutes = 0;
config.save();
}
示例7: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(
event.getSuggestedConfigurationFile());
config.load();
betterhopperid = config.getBlock("BetterHopper", 2800).getInt();
fasterhopperid = config.getBlock("FasterHopper", 2801).getInt();
biggerhopperid = config.getBlock("BiggerHopper", 2802).getInt();
strongerhopperid = config.getBlock("StrongerHopper", 2803).getInt();
fasterstrongerhopperid = config.getBlock("FasterStrongerHopper", 2804).getInt();
fasterbiggerhopperid = config.getBlock("FasterBiggerHopper", 2805).getInt();
biggerstrongerhopperid = config.getBlock("BiggerStrongerHopper", 2806).getInt();
fasterbiggerstrongerhopperid = config.getBlock("FasterBiggerStrongerHopper", 2807).getInt();
config.addCustomCategoryComment("Enable", "Enable/Disable");
enableBetterHopper = config.get("Enable", "BetterHopper", true).getBoolean(true);
enableFasterHopper = config.get("Enable", "FasterHopper", true).getBoolean(true);
enableBiggerHopper = config.get("Enable", "BiggerHopper", true).getBoolean(true);
enableStrongerHopper = config.get("Enable", "StrongerHopper", true).getBoolean(true);
config.save();
}
示例8: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的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");
}
示例9: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
saveDat = new File(event.getSuggestedConfigurationFile().getParentFile().getAbsolutePath() + "/" + MODID + "/savedInv.dat");
create(saveDat);
recipeDat = new File(event.getSuggestedConfigurationFile().getParentFile().getAbsolutePath() + "/" + MODID + "/savedRecipe.dat");
create(recipeDat);
GameRegistry.registerPlayerTracker(new PlayerTracker());
//Config
File configFile = new File(event.getSuggestedConfigurationFile().getParentFile().getAbsolutePath() + "/" + MODID + "/specificInventory.cfg");
create(configFile);
Configuration config = new Configuration(configFile);
config.load();
canModify = config.get("canModify", "general", false, "Can modify starting inventory.").getBoolean(false);
freshInventory = config.get("replaceInventory","general",false, "true = replaces entire inventory. false = add items to inventory.").getBoolean(false);
config.save();
}
示例10: init
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void init(File configFileCPU) {
Configuration configCpu = new Configuration(configFileCPU);
configCpu.load();
//Blocks
Ids.actualElectrolyser = configCpu.getBlock(configCpu.CATEGORY_BLOCK, Names.Electrolyser_BlockName, Ids.baseElectrolyser).getInt();
Ids.actualFluidMercury = configCpu.getBlock(configCpu.CATEGORY_BLOCK, Names.FluidMercury_FluidName, Ids.baseFluidMercury).getInt();
//Items
Ids.actualEmptyCell = configCpu.getItem(configCpu.CATEGORY_ITEM, Names.EmptyCell_ItemName, Ids.baseEmptyCell).getInt() - 256;
Ids.actualWaterCell = configCpu.getItem(configCpu.CATEGORY_ITEM, Names.WaterCell_ItemName, Ids.baseWaterCell).getInt() - 256;
Ids.actualLavaCell = configCpu.getItem(configCpu.CATEGORY_ITEM, Names.LavaCell_ItemName, Ids.baseLavaCell).getInt() - 256;
Ids.actualMercuryBucket = configCpu.getItem(configCpu.CATEGORY_ITEM, Names.BucketMercury_FluidName, Ids.baseMercuryBucket).getInt() - 256;
Ids.actualRFReader = configCpu.getItem(configCpu.CATEGORY_ITEM, Names.RFReader_ItemName, Ids.baseRFReader).getInt();
Ids.actualElementCellT = configCpu.getItem(configCpu.CATEGORY_ITEM, Names.ElementsCell_ItemName, Ids.baseElementCell).getInt();
//RetroGen
configCpu.addCustomCategoryComment("Retrogen", "Regen Ores In An Already Present World");
SpecialConfig.RegenFluidMercury = configCpu.get("Retrogen", "Fluid Mercury", false).getBoolean(false);
//End
configCpu.save();
}
示例11: 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();
}
示例12: createConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void createConfig(FMLPreInitializationEvent event) {
Configuration config = new Configuration(new File(event.getModConfigurationDirectory() + "Updater.cfg"));
try {
config.load();
DataProxy.versionurl = config.get(Reference.options, "URL used to check for updates", "http://www.dnstechpack.com/<path>").getString();
DataProxy.infourl = config.get(Reference.options, "URL used to provide update info", "http://www.dnstechpack.com/<path>").getString();
DataProxy.delay = config.get(Reference.options, "How long to wait before notifications are shown", 200).getInt();
Reference.updaterName = config.get(Reference.options, "Name of the modpack the updater will use", "DNS Techpack").getString();
Reference.outputColour = config.get(Reference.options, "The colout the updater will use", "green").getString();
Reference.allowCape = config.get(Reference.options, "Do you want to enable cape rendering", true).getBoolean(true);
} catch(Exception e) {
e.printStackTrace();
} finally {
if(config.hasChanged())
config.save();
}
}
示例13: initialize
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void initialize(File file) {
Configuration config = new Configuration(file);
config.load();
PlanksID = config.getBlock("Plank IDs", 509).getInt();
StonesID = config.getBlock("Stone IDs", 510).getInt();
StoneBricksID = config.getBlock("Stone Brick IDs", 511).getInt();
ReinforcedBricksID = config.getBlock("Reinforced Brick IDs", 512).getInt();
Rare = config.get("Generation", "Rarity of Stones", 3).getInt();
for (String id : config.get("Generation", "Allowed Dimension ID", "0,").getString().split(",")) {
try {
allowed.add(Integer.parseInt(id.trim()));
} catch (NumberFormatException e) {
}
}
config.save();
}
示例14: init
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void init(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
helmet = config.getItem("pigtitehelmet", 2222).getInt();
chestplate= config.getItem("pigtitechestplate", 2223).getInt();
leggings= config.getItem("pigtiteleggings", 2224).getInt();
boots= config.getItem("pigtiteboots", 2225).getInt();
pickaxe= config.getItem("pigtitepickaxe", 2226).getInt();
sword= config.getItem("pigtitesword", 2227).getInt();
axe= config.getItem("pigtiteaxe", 2228).getInt();
hoe= config.getItem("pigtitehoe", 2229).getInt();
shovel= config.getItem("pigtiteshovel", 2230).getInt();
multi= config.getItem("pigtitepaxel", 2232).getInt();
bow = config.getItem("pigtitebow", 2233).getInt();
pigtite = config.getItem("pigtite", 2231).getInt();
bacon = config.getItem("bacon", 2234).getInt();
ore = config.getBlock("pigtiteore", 2232).getInt();
spawnGnomorian = config.getItem("spawnGnomorian", 2236).getInt();
spawnBudder92 = config.getItem("spawnBudder92", 2236).getInt();
spawndomonator12 = config.getItem("spawndomonator12", 2236).getInt();
spawnjo10Trot = config.getItem("spawnjo10Trot", 2236).getInt();
spawnMIXERRULES = config.getItem("spawnMIXERRULES", 2236).getInt();
spawnMonkrules10 = config.getItem("spawnMonkrules10", 2236).getInt();
spawnfameblue = config.getItem("spawnfameblue", 2237).getInt();
spawnMyskitBread = config.getItem("spawnMyskitBread", 2238).getInt();
spawnrducey99 = config.getItem("spawnrducey99", 2239).getInt();
spawnVinbullet = config.getItem("spawnVinbullet", 2240).getInt();
config.save();
}
示例15: loadConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
private static void loadConfig() {
Configuration wirelessconfig = ConfigurationLib.getConfig();
wirelessconfig.load();
pdID = wirelessconfig.get(Configuration.CATEGORY_ITEM,
ItemLib.POWER_DIR,
6243).getInt();
wirelessconfig.save();
}