本文整理汇总了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) {
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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());
}
示例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());
}
示例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));
}
}