Class SaveFile

java.lang.Object
eu.endercentral.crazy_advancements.save.SaveFile

public class SaveFile extends Object
Represents a Save File
Author:
Axel
  • Constructor Details

    • SaveFile

      public SaveFile(List<ProgressData> progressData, List<CriteriaData> criteriaData)
      Constructor for creating a Save File
      Parameters:
      progressData - A list of Advancement Progress that is saved by progress number
      criteriaData - A list of Advancement Progress that is saved by criteria list
  • Method Details

    • getProgressData

      public Collection<ProgressData> getProgressData()
      Gets a list of Advancement Progress that is saved by progress number
      Returns:
      The list containing ProgressData
    • getCriteriaData

      public Collection<CriteriaData> getCriteriaData()
      Gets a list of Advancement Progress that is saved by criteria list
      Returns:
      The list containing CriteriaData
    • merge

      public void merge(SaveFile saveFile)
      Merges another Save File onto this one
      The Save File that is merged will take priority
      Parameters:
      saveFile - The Save File that should be merged into this one
    • toJson

      public String toJson()
      Converts this Save File to JSON
      Returns:
      the JSON String
    • fromJSON

      public static SaveFile fromJSON(String json)
      Creates a Save File from JSON Input
      Parameters:
      json - The Input JSON
      Returns:
      The newly created Save File
    • fromJSON

      public static SaveFile fromJSON(com.google.gson.JsonElement json)
      Creates a Save File from JSON Input
      Parameters:
      json - The Input JSON
      Returns:
      The newly created Save File