Record Class FoliosBook

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.FoliosBook
Record Components:
name - raw, as written: a translation key or text (title() reads it)
subtitle - raw; empty for none
landing - raw marked-up text of the book's first page
style - how the book is shown: FoliosStyles.SCREEN, FoliosStyles.HANDHELD or one a mod adds
accent - the book's colour, for marks, links and highlights (RGB)
cover - the colour of a handheld book's cover (RGB)
coverTexture - a texture for a handheld book's cover, drawn over its colour; null for none
models - the models it is shown with: the item's, the open book's others see, a handheld book's cover
showProgress - whether how much of it has been read is shown
tilt - how far a handheld book leans back from facing the reader, in degrees (0 faces them squarely)
distance - how far a handheld book is held from the reader's eyes, in blocks
pageTurn - how a handheld book's leaves turn
reveal - how a page's content shows once it is turned to ("reveal"; see FoliosReveal)
textures - the layers it is drawn with
layout - where the tabs, turn buttons and page numbers sit
clickOutsideCloses - whether a click off the book closes it ("close_on_click_outside"; by default true for a handheld book, false for a screen one)
handling - what a reader can do while holding a handheld book open ("handheld")
colors - its colour scheme over the style's own: the page's colours and its tooltips' ("colors")
coverText - where its name and subtitle are lettered on its cover, and how large ("cover_text")
progress - where what is read in it is kept: with each player, or on each copy of the book ("progress")

public record FoliosBook(net.minecraft.resources.Identifier id, String name, String subtitle, String landing, net.minecraft.resources.Identifier style, int accent, int cover, @Nullable net.minecraft.resources.Identifier coverTexture, FoliosIcon icon, FoliosBook.Models models, boolean showProgress, float tilt, float distance, FoliosBook.PageTurn pageTurn, FoliosReveal.Use reveal, FoliosBook.Textures textures, FoliosBook.Layout layout, boolean clickOutsideCloses, FoliosBook.Handling handling, FoliosBook.Colors colors, FoliosBook.CoverText coverText, FoliosBook.Progress progress, List<FoliosCategory> categories, Map<String, FoliosEntry> entries, Map<net.minecraft.world.item.Item, FoliosBook.Location> itemIndex) extends Record
A guide book, as read from assets/<namespace>/folios/<path>/book.json and the categories and entries beside it. Books are read again whenever resources reload; don't keep one past that.
  • Constructor Details

  • Method Details

    • itemModel

      public @Nullable net.minecraft.resources.Identifier itemModel()
      The item model the folios:guide_book item takes for this book; null for its own.
    • title

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

      public @Nullable FoliosCategory category(String id)
    • entry

      public @Nullable FoliosEntry entry(String id)
    • visibleCategories

      public List<FoliosCategory> visibleCategories()
      The categories the player can see, in order.
    • entries

      public List<FoliosEntry> entries(String category)
      A category's entries the player can see, featured first.
    • about

      public @Nullable FoliosBook.Location about(net.minecraft.world.item.ItemStack stack)
      The page about an item, from the items its pages are about; null when none is.
    • 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 net.minecraft.resources.Identifier id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

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

      public String subtitle()
      Returns the value of the subtitle record component.
      Returns:
      the value of the subtitle record component
    • landing

      public String landing()
      Returns the value of the landing record component.
      Returns:
      the value of the landing record component
    • style

      public net.minecraft.resources.Identifier style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • accent

      public int accent()
      Returns the value of the accent record component.
      Returns:
      the value of the accent record component
    • cover

      public int cover()
      Returns the value of the cover record component.
      Returns:
      the value of the cover record component
    • coverTexture

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

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

      public FoliosBook.Models models()
      Returns the value of the models record component.
      Returns:
      the value of the models record component
    • showProgress

      public boolean showProgress()
      Returns the value of the showProgress record component.
      Returns:
      the value of the showProgress record component
    • tilt

      public float tilt()
      Returns the value of the tilt record component.
      Returns:
      the value of the tilt record component
    • distance

      public float distance()
      Returns the value of the distance record component.
      Returns:
      the value of the distance record component
    • pageTurn

      public FoliosBook.PageTurn pageTurn()
      Returns the value of the pageTurn record component.
      Returns:
      the value of the pageTurn record component
    • reveal

      public FoliosReveal.Use reveal()
      Returns the value of the reveal record component.
      Returns:
      the value of the reveal record component
    • textures

      public FoliosBook.Textures textures()
      Returns the value of the textures record component.
      Returns:
      the value of the textures record component
    • layout

      public FoliosBook.Layout layout()
      Returns the value of the layout record component.
      Returns:
      the value of the layout record component
    • clickOutsideCloses

      public boolean clickOutsideCloses()
      Returns the value of the clickOutsideCloses record component.
      Returns:
      the value of the clickOutsideCloses record component
    • handling

      public FoliosBook.Handling handling()
      Returns the value of the handling record component.
      Returns:
      the value of the handling record component
    • colors

      public FoliosBook.Colors colors()
      Returns the value of the colors record component.
      Returns:
      the value of the colors record component
    • coverText

      public FoliosBook.CoverText coverText()
      Returns the value of the coverText record component.
      Returns:
      the value of the coverText record component
    • progress

      public FoliosBook.Progress progress()
      Returns the value of the progress record component.
      Returns:
      the value of the progress record component
    • categories

      public List<FoliosCategory> categories()
      Returns the value of the categories record component.
      Returns:
      the value of the categories record component
    • entries

      public Map<String, FoliosEntry> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component
    • itemIndex

      public Map<net.minecraft.world.item.Item, FoliosBook.Location> itemIndex()
      Returns the value of the itemIndex record component.
      Returns:
      the value of the itemIndex record component