Record Class FoliosEntry

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.FoliosEntry
Record Components:
name - raw, as written: a translation key or text with marks (title() reads it)
sort - lower comes first, then by name
featured - shown first in its category, marked
listings - its pages and elements that the book's index and search list as if each were an entry of its own

public record FoliosEntry(String id, String category, String name, FoliosIcon icon, int sort, boolean featured, FoliosLock lock, List<FoliosEntry.Page> pages, @Nullable FoliosReveal.Use reveal, List<FoliosEntry.Listing> listings) extends Record
An entry of a book: a titled run of pages, in a category. Read from entries/<id>.json in the book's folder; its id is that path ("basics/first_steps").
  • Constructor Details

    • FoliosEntry

      public FoliosEntry(String id, String category, String name, FoliosIcon icon, int sort, boolean featured, FoliosLock lock, List<FoliosEntry.Page> pages, @Nullable FoliosReveal.Use reveal, List<FoliosEntry.Listing> listings)
      Creates an instance of a FoliosEntry record class.
      Parameters:
      id - the value for the id record component
      category - the value for the category record component
      name - the value for the name record component
      icon - the value for the icon record component
      sort - the value for the sort record component
      featured - the value for the featured record component
      lock - the value for the lock record component
      pages - the value for the pages record component
      reveal - the value for the reveal record component
      listings - the value for the listings record component
    • FoliosEntry

      public FoliosEntry(String id, String category, String name, FoliosIcon icon, int sort, boolean featured, FoliosLock lock, List<FoliosEntry.Page> pages, @Nullable FoliosReveal.Use reveal)
      An entry with nothing of it listed on its own.
    • FoliosEntry

      public FoliosEntry(String id, String category, String name, FoliosIcon icon, int sort, boolean featured, FoliosLock lock, List<FoliosEntry.Page> pages)
      An entry that reveals its pages as its book does.
  • Method Details

    • title

      public net.minecraft.network.chat.Component title()
    • objectives

      public List<FoliosObjective> objectives()
      Everything its pages ask the player to do; empty for an entry that isn't a quest.
    • isQuest

      public boolean isQuest()
    • isOpen

      public boolean isOpen()
    • isVisible

      public boolean isVisible()
    • 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • category

      public String category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • icon

      public FoliosIcon icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • sort

      public int sort()
      Returns the value of the sort record component.
      Returns:
      the value of the sort record component
    • featured

      public boolean featured()
      Returns the value of the featured record component.
      Returns:
      the value of the featured record component
    • lock

      public FoliosLock lock()
      Returns the value of the lock record component.
      Returns:
      the value of the lock record component
    • pages

      public List<FoliosEntry.Page> pages()
      Returns the value of the pages record component.
      Returns:
      the value of the pages record component
    • reveal

      public @Nullable FoliosReveal.Use reveal()
      Returns the value of the reveal record component.
      Returns:
      the value of the reveal record component
    • listings

      public List<FoliosEntry.Listing> listings()
      Returns the value of the listings record component.
      Returns:
      the value of the listings record component