Esempio n. 1
0
  public String loadFromJson(String filename) {
    File file = new File(filename);
    String json;
    try {
      json = FileUtils.readFileToString(file);
    } catch (IOException e) {
      return "Error reading file!";
    }

    NBTTagCompound tagCompound;
    try {
      tagCompound = (NBTTagCompound) JsonToNBT.func_150315_a(json);
    } catch (NBTException e) {
      return "NBT Error: " + e.getMessage();
    }

    readFromNBT(tagCompound);

    return null;
  }