Record Class FoliosLock

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.FoliosLock
Record Components:
book - the book it is in, whose reading its conditions ask about

public record FoliosLock(@Nullable net.minecraft.resources.Identifier book, List<FoliosObjective> requires, boolean secret) extends Record
What keeps a category, entry or page closed until the player has earned it. In JSON these are fields of the thing locked:
  • "requires": a condition, written as a quest objective is (FoliosObjective), or a list of them all of which must hold: "requires": {"advancement": "mymod:story/found_ore"}, "requires": [{"read": "basics/first_steps"}, {"obtained": "minecraft:diamond"}];
  • "secret": true: left out until it opens, where it would otherwise be shown locked.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FoliosLock
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FoliosLock(@Nullable net.minecraft.resources.Identifier book, List<FoliosObjective> requires, boolean secret)
    Creates an instance of a FoliosLock record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.resources.Identifier
    Returns the value of the book record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
    Whether it is shown at all: open, or locked but not secret.
    static FoliosLock
    read(com.google.gson.JsonObject json, net.minecraft.resources.Identifier book)
    The lock an object of a book's JSON (a category, an entry or a page) has.
    Returns the value of the requires record component.
    boolean
    Returns the value of the secret record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • FoliosLock

      public FoliosLock(@Nullable net.minecraft.resources.Identifier book, List<FoliosObjective> requires, boolean secret)
      Creates an instance of a FoliosLock record class.
      Parameters:
      book - the value for the book record component
      requires - the value for the requires record component
      secret - the value for the secret record component
  • Method Details

    • read

      public static FoliosLock read(com.google.gson.JsonObject json, net.minecraft.resources.Identifier book)
      The lock an object of a book's JSON (a category, an entry or a page) has.
    • isOpen

      public boolean isOpen()
    • isVisible

      public boolean isVisible()
      Whether it is shown at all: open, or locked but not secret.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • book

      public @Nullable net.minecraft.resources.Identifier book()
      Returns the value of the book record component.
      Returns:
      the value of the book record component
    • requires

      public List<FoliosObjective> requires()
      Returns the value of the requires record component.
      Returns:
      the value of the requires record component
    • secret

      public boolean secret()
      Returns the value of the secret record component.
      Returns:
      the value of the secret record component