Class PersistentDataHolder

java.lang.Object
net.tnemc.item.persistent.PersistentDataHolder

public class PersistentDataHolder extends Object
PersistentDataHolder
Since:
0.2.0.0
Author:
creatorfromhell
  • Constructor Details

  • Method Details

    • readJSON

      public void readJSON(org.json.simple.JSONObject json, ItemPlatform<?,?,?> platform)
      Decodes the JSON object and sets the values in the current instance.
      Parameters:
      json - The JSON object to be decoded
      Since:
      0.2.0.0
    • toJSON

      public org.json.simple.JSONObject toJSON()
      Convert a PersistentDataHolder object to a JSONObject.
      Returns:
      The JSONObject representation of the PersistentDataHolder object.
      Since:
      0.2.0.0
    • decode

      public Optional<PersistentDataType<?>> decode(JSONHelper json, ItemPlatform<?,?,?> platform)
      Decodes the provided JSON object and returns an Optional containing the decoded PersistentDataType.
      Parameters:
      json - The JSONHelper object to be decoded
      Returns:
      An Optional containing the decoded PersistentDataType if it exists, otherwise an empty Optional
      Since:
      0.2.0.0
    • getData