Beispiel #1
0
 public static WorldInfo getInfo(String worldname) {
   WorldInfo info = null;
   try {
     Tag t = getData(worldname);
     if (t != null) {
       info = new WorldInfo();
       info.name = t.findTagByName("LevelName").getValue().toString();
       info.seed = (Long) t.findTagByName("RandomSeed").getValue();
       info.size = (Long) t.findTagByName("SizeOnDisk").getValue();
       info.time = (Long) t.findTagByName("Time").getValue();
       info.raining = ((Byte) t.findTagByName("raining").getValue()) != 0;
       info.thundering = ((Byte) t.findTagByName("thundering").getValue()) != 0;
       if (info.size == 0) info.size = getWorldSize(worldname);
     }
   } catch (Exception ex) {
   }
   World w = getWorld(worldname);
   if (w != null) {
     if (info == null) {
       info = new WorldInfo();
       info.size = getWorldSize(worldname);
     }
     info.name = w.getName();
     info.seed = w.getSeed();
     info.time = w.getFullTime();
     info.raining = w.hasStorm();
     info.thundering = w.isThundering();
   }
   return info;
 }