本文整理匯總了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));
}
}