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


Java ConfigurationSection.set方法代码示例

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


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

示例1: save

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public void save() {
    config.set("lastNewDay", lastNewDay);
    config.set("lastPowerUpdate", lastPowerUpdate);

    if (!config.contains("power")) {
        config.createSection("power");
    }
    ConfigurationSection powerSection = config.getConfigurationSection("power");
    for (Entry<UUID, Double> entry : power.entrySet()) {
        powerSection.set(entry.getKey().toString(), entry.getValue());
    }
    config.set("power", powerSection);

    try {
        config.save(FILE);
    } catch (IOException exception) {
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:19,代码来源:FData.java

示例2: link

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public static void link(Player p, int tsDbId){
	String uuid = p.getUniqueId().toString();
	
	UtilsStorage storageType = Utils.getStorageType();
	if(storageType == UtilsStorage.FILE){
		if(!isLinked(p)){
			ConfigurationSection cs = UltimateTs.linkedPlayers.getConfigurationSection("linked");
			cs.set(uuid, tsDbId);
			UltimateTs.linkedPlayers.save();
		}
	}else if(storageType == UtilsStorage.SQL){
		if(!UltimateTs.main().sql.isUUIDLinked(uuid)){
			UltimateTs.main().sql.validLink(uuid, tsDbId);
		}
	}
	assignRanks(p, tsDbId);
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:18,代码来源:PlayerManager.java

示例3: unlink

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
public static void unlink(Player p){
	String uuid = p.getUniqueId().toString();
	
	UtilsStorage storageType = Utils.getStorageType();
	removeRanks(p);
	if(storageType == UtilsStorage.FILE){
		if(isLinked(p)){
			ConfigurationSection cs = UltimateTs.linkedPlayers.getConfigurationSection("linked");
			cs.set(uuid, 0);
			UltimateTs.linkedPlayers.save();
		}
	}else if(storageType == UtilsStorage.SQL){
		if(UltimateTs.main().sql.isUUIDLinked(uuid)){
			UltimateTs.main().sql.unlink(uuid);
		}
	}
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:18,代码来源:PlayerManager.java

示例4: removeUnusedValues

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
private void removeUnusedValues(ConfigurationSection cs) {
	Map<String, Object> objs = cs.getValues(false);
	for (String key : objs.keySet()) {
		if (cs.isConfigurationSection(key)) {
			removeUnusedValues(cs.getConfigurationSection(key));
			if (cs.getConfigurationSection(key) == null || cs.getConfigurationSection(key).getValues(false).isEmpty()) {
				cs.set(key, null);
			}
		} else if (!defaultValues.containsKey(cs.getCurrentPath() + (cs.getCurrentPath().isEmpty() ? "" : ".") + key)) {
			cs.set(key, null);
		}
	}
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:14,代码来源:Conf.java

示例5: serialize

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
@Override
public void serialize(ConfigurationSection config) {
    ISerializable.serialize(config, this);
    config.set("duration", duration.toString());
    config.set("resetPeriod", resetPeriod.toString());
    config.set("periodCountingBase", periodCountingBase.toString());

    config.set("creationTime", creationTime.toString());
    config.set("lastTimerCallback", lastTimerCallback.toString());
    config.set("lastResetCallback", lastResetCallback.toString());
    config.set("lastCheckpoint", lastCheckpoint.toString());
    config.set("timeElapsed", timeElapsed.toString());
}
 
开发者ID:NyaaCat,项目名称:NyaaCore,代码行数:14,代码来源:TimerPersistData.java

示例6: serialize

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
@Override
public void serialize(ConfigurationSection config) {
    ISerializable.serialize(config, this);
    config.set("duration", duration.toString());
    config.set("resetPeriod", resetPeriod.toString());
    config.set("periodCountingBase", periodCountingBase.toString());
}
 
开发者ID:NyaaCat,项目名称:NyaaCore,代码行数:8,代码来源:TimerData.java

示例7: serialize

import org.bukkit.configuration.ConfigurationSection; //导入方法依赖的package包/类
@Override
public void serialize(ConfigurationSection config) {
    config.set("spawn", null);
    ISerializable.serialize(config, this);
    ConfigurationSection cfg = config.createSection("spawn");
    for (UUID uuid : playerSpawn.keySet()) {
        cfg.set(uuid.toString(), playerSpawn.get(uuid));
    }
}
 
开发者ID:NyaaCat,项目名称:Ourtown,代码行数:10,代码来源:PlayerConfig.java


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