• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FileConfigurationOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bukkit.configuration.file.FileConfigurationOptions的典型用法代码示例。如果您正苦于以下问题:Java FileConfigurationOptions类的具体用法?Java FileConfigurationOptions怎么用?Java FileConfigurationOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FileConfigurationOptions类属于org.bukkit.configuration.file包,在下文中一共展示了FileConfigurationOptions类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testUpdateConfigurationAllUpdate

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
@Test
public void testUpdateConfigurationAllUpdate() throws Exception {
	whenNew(YamlConfiguration.class).withAnyArguments().thenReturn(mock(YamlConfiguration.class));
	when(configuration.isSet(anyString())).thenReturn(false);
	when(configuration.isSet("general.messaging.reportList")).thenReturn(true);
	when(configuration.isSet("general.messaging.broadcast")).thenReturn(true);
	when(configuration.isSet("general.locale")).thenReturn(true);
	when(configuration.isSet("general.localeAutoDownload")).thenReturn(true);
	when(configuration.isSet("general.checkForUpdates")).thenReturn(true);
	when(configuration.isSet("general.checkForDevUpdates")).thenReturn(true);
	when(configuration.isSet("locale.localeAutoDownload")).thenReturn(true);
	when(configuration.isSet("locale.keepLocaleBackupFile")).thenReturn(true);
	when(configuration.isSet("general.reporting.alerts.limitReached")).thenReturn(true);
	when(configuration.isSet("general.reporting.alerts.allowedToReportAgain")).thenReturn(true);

	when(configuration.options()).thenReturn(mock(FileConfigurationOptions.class));

	assertTrue(ReporterConfigurationUtil.updateConfiguration(configuration));
	verify(configuration, atLeastOnce()).set(anyString(), any(Object.class));
}
 
开发者ID:KabOOm356,项目名称:Reporter,代码行数:21,代码来源:ReporterConfigurationUtilTest.java


示例2: saveConfig

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
public void saveConfig()
{
    if (config == null || configFile == null)
    {
        return;
    }
    try
    {
    	FileConfigurationOptions opt = config.options();
		opt.header(header);
        getConfig().save(configFile);
    }
    catch (IOException ex) {}
}
 
开发者ID:OnikurYH,项目名称:WorldGifts,代码行数:15,代码来源:FConfig.java


示例3: createConfiguration

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
/**
 * @author xize
 * @param creates the configuration, if the configuration already exists we skip this.
 */
@SuppressWarnings("deprecation")
public void createConfiguration() {
	try {
		this.f = new File(pl.getDataFolder() + File.separator + "config.yml");
		if(f.exists()) {
			this.con = YamlConfiguration.loadConfiguration(f);
			ManCo.log(LogType.INFO, "Configuration file found!");
		} else {
			ManCo.log(LogType.INFO, "Configuration file is not found, generating a new one!");
			File dir = new File(pl.getDataFolder() + File.separator + "schematics");
			if(!dir.isDirectory()) {
				dir.mkdir();
			}
			con = YamlConfiguration.loadConfiguration(f);
			FileConfigurationOptions opt = con.options();
			opt.header("this plugin has been created by xize.");
			con.set("crate.dropsPerSchedule", 5);
			con.set("crate.rareCrateChance", 10);
			con.set("crate.schedule", 10);
			con.set("crate.protectChestAgainstOthers", true);
			con.set("crate.spawnRandom", false);
			con.set("crate.messages.enable", true);
			con.set("crate.messages.normalDropMessage", "&2an %crate crate has been dropped close to %p");
			con.set("crate.messages.rareDropMessage", "&5a rare crate %crate has been spawned near %p");
			ItemStack item1 = new ItemStack(Material.STONE_SWORD, 1);
			item1.addUnsafeEnchantment(Enchantment.KNOCKBACK, 2);
			ItemStack item2 = new ItemStack(Material.BREAD, 4);
			ItemStack item3 = new ItemStack(Material.IRON_SPADE, 1);
			item3.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 3);
			List<ItemStack> items = new ArrayList<ItemStack>();
			items.add(item1);
			items.add(item2);
			items.add(item3);

			//a reminder for the crate system
			//the new chest inventory system will work with ItemMeta and enchants
			//however since its almost impossible to make it good configurable
			//we decided to mirror fake inventorys which will save and load on inventory open and close.

			con.set("crates.crate.serie51.isEnabled", true);
			con.set("crates.crate.serie51.isRare", false);
			con.set("crates.crate.serie51.rareEffects", false);
			con.set("crates.crate.serie51.keyEnable", true);
			con.set("crates.crate.serie51.keyItem", Material.BLAZE_ROD.name());
			con.set("crates.crate.serie51.keyPrice", 3.0);
			con.set("crates.crate.serie51.miniumSlotsFilled", 10);
			con.set("crates.crate.serie51.items", items.toArray());

			ItemStack item4 = new ItemStack(Material.GOLD_SWORD, 1);
			item2.addUnsafeEnchantment(Enchantment.DAMAGE_UNDEAD, 1);
			ItemStack item5 = new ItemStack(Material.APPLE, 4);
			ItemStack item6 = new ItemStack(Material.IRON_AXE, 1);
			item3.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 10);
			List<ItemStack> items2 = new ArrayList<ItemStack>();
			items2.add(item4);
			items2.add(item5);
			items2.add(item6);

			con.set("crates.crate.serie61.isEnabled", true);
			con.set("crates.crate.serie61.isRare", true);
			con.set("crates.crate.serie61.rareEffects", true);
			con.set("crates.crate.serie61.keyEnable", true);
			con.set("crates.crate.serie61.keyItem", Material.STICK.getId());
			con.set("crates.crate.serie61.keyPrice", 1.0);
			con.set("crates.crate.serie61.miniumSlotsFilled", 10);
			con.set("crates.crate.serie61.items", items2.toArray());

			con.save(f);
		}
	} catch(Exception e) {
		e.printStackTrace();
	}
	loadCrates();
}
 
开发者ID:xize,项目名称:manco2,代码行数:79,代码来源:Configuration.java


示例4: options

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
public FileConfigurationOptions options() {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FileConfiguration.java


示例5: FileConfigurationOptions

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
protected FileConfigurationOptions(MemoryConfiguration configuration) {
       super(configuration);
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FileConfigurationOptions.java


示例6: copyDefaults

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
public FileConfigurationOptions copyDefaults(boolean value) {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FileConfigurationOptions.java


示例7: pathSeparator

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
public FileConfigurationOptions pathSeparator(char value) {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FileConfigurationOptions.java


示例8: header

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
public FileConfigurationOptions header(String value) {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FileConfigurationOptions.java


示例9: copyHeader

import org.bukkit.configuration.file.FileConfigurationOptions; //导入依赖的package包/类
public FileConfigurationOptions copyHeader(boolean value) {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FileConfigurationOptions.java



注:本文中的org.bukkit.configuration.file.FileConfigurationOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Clock类代码示例发布时间:2022-05-23
下一篇:
Java TooltipHandlerFX类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap