本文整理汇总了Java中org.bukkit.configuration.file.YamlConfiguration.getDouble方法的典型用法代码示例。如果您正苦于以下问题:Java YamlConfiguration.getDouble方法的具体用法?Java YamlConfiguration.getDouble怎么用?Java YamlConfiguration.getDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.configuration.file.YamlConfiguration
的用法示例。
在下文中一共展示了YamlConfiguration.getDouble方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.bukkit.configuration.file.YamlConfiguration; //导入方法依赖的package包/类
public static FireCraftTableRecipe load(String name){
File f=new File(rs.getDataFolder()+File.separator+"SyntheticFormula"+File.separator+"FireCraftTable"+File.separator+name+".yml");
if(!f.exists())return null;
YamlConfiguration recipe=YamlConfiguration.loadConfiguration(f);
HashMap<Character,ItemStack> materials=new HashMap<>();
char c=' ';
for(String s:recipe.getStringList(name+".shape"))
for(char temp:s.toCharArray())
if(temp!=' '&&temp!=c){
c=temp;
materials.put(c, recipe.getItemStack(name+".material."+c));
}
ItemStack[] product=new ItemStack[4];
for(int i=0;i<3;i++)
product[i]=recipe.getItemStack(name+".product."+i);
return new FireCraftTableRecipe(recipe.getInt(name+".time"),recipe.getDouble(name+".temperature"),recipe.getInt(name+".maxTime"), name,
recipe.getStringList(name+".shape"), materials, product);
}
示例2: getPlayerData
import org.bukkit.configuration.file.YamlConfiguration; //导入方法依赖的package包/类
/**
* ��ȡPlayerData
* @param rs ����·��
* @param p Player����
* @return PlayerData����
*/
public static PlayerData getPlayerData(Player p){
File data=new File(rs.getDataFolder()+File.separator+"PlayerDatas"+File.separator+p.getUniqueId().toString()+".yml");
PlayerData pd;
if(!data.exists()){
try {data.createNewFile();} catch (IOException e) {}
pd=new PlayerData(p.getUniqueId(),p.getWorld().getName(), rs.getSleepMax(),
rs.getThirstMax(), 0, 37,0, rs.getPhysical_strength());
return pd;
}
YamlConfiguration dataC=YamlConfiguration.loadConfiguration(data);
HashMap<String,Object[]> sickKind=new HashMap<String,Object[]>();
for(String temp:dataC.getStringList("rSickKind")){
List<String> l=dataC.getStringList("sickKind."+temp);
sickKind.put(temp,new Object[]{l.get(0),l.get(1),l.get(2),l.get(3)} );
}
pd=new PlayerData( p.getUniqueId(),dataC.getString("world"), dataC.getDouble("sleep"),
dataC.getDouble("thirst"), dataC.getDouble("temperature"), dataC.getDouble("weight"),
dataC.getDouble("physical_strength"),dataC.getBoolean("sick"),
dataC.getBoolean("isSleep"),Byte.parseByte(dataC.getString("light")),sickKind);
return pd;
}
示例3: loadData
import org.bukkit.configuration.file.YamlConfiguration; //导入方法依赖的package包/类
public void loadData() {
file = new PluginFile(main, "data", FileType.YAML);
YamlConfiguration config = file.returnYaml();
checkDefaults();
// Supplydrops related.
for (String worldString : config.getStringList("supply-drops.enabled-worlds")) {
supplyDropWorlds.add(Bukkit.getWorld(worldString));
}
// Radiation related.
this.defaultRadiationDamage = config.getDouble("radiation.default-damage");
this.stormRadiationDamage = config.getDouble("radiation.storm-damage");
this.waterRadiationDamage = config.getDouble("radiation.water-damage");
this.radiationDamageDelay = config.getInt("radiation.seconds-delay");
}
示例4: playerQuitJail
import org.bukkit.configuration.file.YamlConfiguration; //导入方法依赖的package包/类
static public void playerQuitJail(Player player){
YamlConfiguration PlayerData = PVPAsWantedManager.onLoadData(player.getName());
double playerX = PlayerData.getDouble("attribute.X");
double playerY = PlayerData.getDouble("attribute.Y");
double playerZ = PlayerData.getDouble("attribute.Z");
World playerWorld = Bukkit.getWorld(PlayerData.getString("attribute.World"));
Location playerLocatioin = new Location(playerWorld,playerX,playerY,playerZ);
player.teleport(playerLocatioin);
/*
if(Config.getConfig("asWantedArrestBroadCastMessage").equals("true")){
Bukkit.broadcastMessage(Message.getMsg("admin.quitJailPlayerMessage",player.getName()));
}
*/
}