本文整理了Java中net.minecraftforge.common.config.Configuration.<init>()
方法的一些代码示例,展示了Configuration.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.<init>()
方法的具体详情如下:
包路径:net.minecraftforge.common.config.Configuration
类名称:Configuration
方法名:<init>
暂无
代码示例来源:origin: Vazkii/Botania
public static void loadConfig(File configFile) {
config = new Configuration(configFile);
config.load();
load();
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private WorldData( @Nonnull final File worldDirectory )
{
Preconditions.checkNotNull( worldDirectory );
Preconditions.checkArgument( worldDirectory.isDirectory() );
this.ae2directory = new File( worldDirectory, AE2_DIRECTORY_NAME );
this.spawnDirectory = new File( this.ae2directory, SPAWNDATA_DIR_NAME );
this.compassDirectory = new File( this.ae2directory, COMPASS_DIR_NAME );
final File settingsFile = new File( this.ae2directory, SETTING_FILE_NAME );
this.sharedConfig = new Configuration( settingsFile, AEConfig.VERSION );
final PlayerData playerData = new PlayerData( this.sharedConfig );
final StorageData storageData = new StorageData( this.sharedConfig );
final ThreadFactory compassThreadFactory = new CompassThreadFactory();
final CompassService compassService = new CompassService( this.compassDirectory, compassThreadFactory );
final CompassData compassData = new CompassData( this.compassDirectory, compassService );
final IWorldSpawnData spawnData = new SpawnData( this.spawnDirectory );
this.playerData = playerData;
this.storageData = storageData;
this.compassData = compassData;
this.spawnData = spawnData;
this.startables = Lists.<IOnWorldStartable>newArrayList( playerData, storageData );
this.stoppables = Lists.<IOnWorldStoppable>newArrayList( playerData, storageData, compassData );
}
代码示例来源:origin: SlimeKnights/TinkersConstruct
public static void load(FMLPreInitializationEvent event) {
configFile = new Configuration(event.getSuggestedConfigurationFile(), "0.1", false);
MinecraftForge.EVENT_BUS.register(instance);
syncConfig();
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
/**
* @param file requires fully qualified file in which the config is saved
*/
public VersionCheckerConfig( @Nonnull final File file )
{
Preconditions.checkNotNull( file );
Preconditions.checkState( !file.isDirectory() );
this.config = new Configuration( file );
// initializes default values by caching
this.isEnabled = this.config.getBoolean( "enabled", "general", true, "If true, the version checker is enabled. Acts as a master switch." );
this.lastCheck = this.config.getString( "lastCheck", "cache", "0",
"The number of milliseconds since January 1, 1970, 00:00:00 GMT of the last successful check." );
this.interval = this.config.getInt( "interval", "cache", DEFAULT_INTERVAL_HOURS, MIN_INTERVAL_HOURS, MAX_INTERVAL_HOURS,
"Waits as many hours, until it checks again." );
this.level = this.config.getString( "level", "channel", "Beta",
"Determines the channel level which should be checked for updates. Can be either Stable, Beta or Alpha." );
this.shouldNotifyPlayer = this.config.getBoolean( "notify", "client", true,
"If true, the player is getting a notification, that a new version is available." );
this.shouldPostChangelog = this.config.getBoolean( "changelog", "client", true,
"If true, the player is getting a notification including changelog. Only happens if notification are enabled." );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final File versionFile = new File( this.configDirectory, "VersionChecker.cfg" );
final File recipeFile = new File( this.configDirectory, "CustomRecipes.cfg" );
final Configuration recipeConfiguration = new Configuration( recipeFile );
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final Configuration configurartion = migrate( new Configuration( configFile, CONFIG_VERSION ) );
代码示例来源:origin: ForestryMC/ForestryMC
public static final Configuration getModulesConfiguration() {
if (config == null) {
config = new Configuration(new File(Forestry.instance.getConfigFolder(), MODULE_CONFIG_FILE_NAME));
}
return config;
}
代码示例来源:origin: SlimeKnights/Mantle
@Override
public void load()
{
config = new Configuration(new File(this.confPath), "1");
config.load();
}
代码示例来源:origin: MrCrayfish/MrCrayfishDeviceMod
public static void load(File file)
{
config = new Configuration(file);
init();
}
代码示例来源:origin: Glitchfiend/ToughAsNails
protected ConfigHandler(File configFile, String description)
{
config = new Configuration(configFile);
loadConfiguration();
MinecraftForge.EVENT_BUS.register(this);
this.description = description;
ModConfig.configHandlers.add(this);
}
代码示例来源:origin: Glitchfiend/SereneSeasons
protected ConfigHandler(File configFile, String description)
{
config = new Configuration(configFile);
loadConfiguration();
MinecraftForge.EVENT_BUS.register(this);
this.description = description;
ModConfig.configHandlers.add(this);
}
代码示例来源:origin: iLexiconn/LLibrary
private <T> T registerConfig(ModContainer mod, File file, T config) {
ConfigContainer configContainer = new ConfigContainer(mod, config, new Configuration(file));
this.configContainers.put(mod.getModId(), configContainer);
configContainer.load();
configContainer.save();
return config;
}
}
代码示例来源:origin: SonarSonic/Calculator
public static void loadBlocks() {
Configuration blocks = new Configuration(new File("config/calculator/Blocks-BlackList.cfg"));
blocks.load();
String[] blockExamples = new String[2];
blockExamples[0] = "ExampleBlock";
blockExamples[1] = "ExampleBlock2";
blocksblackList = blocks.get("Block Config", "Disabled", blockExamples);
blocks.save();
}
代码示例来源:origin: Vazkii/Psi
public static void init(File configFile) {
config = new Configuration(configFile);
config.load();
load();
}
代码示例来源:origin: SleepyTrousers/EnderCore
@Override
public final void initialize(@Nonnull File cfg) {
config = new Configuration(cfg);
init();
reloadAllConfigs();
saveConfigFile();
}
代码示例来源:origin: vadis365/TheErebus
public void loadConfig(FMLPreInitializationEvent event) {
File configFile = event.getSuggestedConfigurationFile();
configFolder = configFile.getParentFile();
config = new Configuration(configFile);
config.load();
syncConfigs();
}
代码示例来源:origin: ata4/dragon-mounts
@EventHandler
public void onPreInit(FMLPreInitializationEvent evt) {
config = new DragonMountsConfig(new Configuration(evt.getSuggestedConfigurationFile()));
metadata = evt.getModMetadata();
proxy.onPreInit(evt);
}
代码示例来源:origin: CoFH/ThermalExpansion
private static void config() {
CONFIG_FLORBS.setConfiguration(new Configuration(new File(CoreProps.configDir, "cofh/" + ThermalExpansion.MOD_ID + "/florbs.cfg"), true));
String category = "General";
String comment = "If TRUE, the recipes for Florbs are enabled. Setting this to FALSE means that you actively dislike fun things.";
enable = CONFIG_FLORBS.getConfiguration().getBoolean("EnableRecipe", category, enable, comment);
category = "Blacklist";
comment = "List of fluids that are not allowed to be placed in Florbs.";
blacklist = CONFIG_FLORBS.getConfiguration().getStringList("Blacklist", category, blacklist, comment);
}
代码示例来源:origin: progwml6/Natura
public static void load(FMLPreInitializationEvent event)
{
configFile = new Configuration(event.getSuggestedConfigurationFile(), "0.2", false);
configFile.load();
syncConfig();
}
代码示例来源:origin: Vazkii/Quark
public static void setupConfig(FMLPreInitializationEvent event) {
configFile = event.getSuggestedConfigurationFile();
if(!configFile.exists())
firstLoad = true;
config = new Configuration(configFile);
config.load();
loadConfig();
MinecraftForge.EVENT_BUS.register(EventHandler.class);
}
内容来源于网络,如有侵权,请联系作者删除!