當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。