Exemple #1
0
 @Override
 public Object getRaw(final String key) {
   final Tag tag = this.findLastTag(key);
   if (tag == null) {
     return null;
   }
   return tag.getValue();
 }
Exemple #2
0
 private static boolean renameWorld(String worldname, String newname) {
   if (isLoaded(worldname)) return false;
   Tag t = getData(worldname);
   if (t == null) return false;
   t = t.findTagByName("Data");
   if (t == null || t.getType() != Type.TAG_Compound) return false;
   int i = 0;
   for (Tag tt : (Tag[]) t.getValue()) {
     if (tt.getName().equals("LevelName")) {
       t.removeTag(i);
       t.insertTag(new Tag(Type.TAG_String, "LevelName", newname), i);
       break;
     }
     i++;
   }
   return setData(worldname, t);
 }