Record Class GuideBook

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.GuideBook
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: GuideStyles.SCREEN, GuideStyles.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 GuideReveal)
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 GuideBook(net.minecraft.resources.ResourceLocation id, String name, String subtitle, String landing, net.minecraft.resources.ResourceLocation style, int accent, int cover, @Nullable net.minecraft.resources.ResourceLocation coverTexture, GuideIcon icon, GuideBook.Models models, boolean showProgress, float tilt, float distance, GuideBook.PageTurn pageTurn, GuideReveal.Use reveal, GuideBook.Textures textures, GuideBook.Layout layout, boolean clickOutsideCloses, GuideBook.Handling handling, GuideBook.Colors colors, GuideBook.CoverText coverText, GuideBook.Progress progress, List<GuideCategory> categories, Map<String,GuideEntry> entries, Map<net.minecraft.world.item.Item,GuideBook.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

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation 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

      @Nullable public @Nullable GuideCategory category(String id)
    • entry

      @Nullable public @Nullable GuideEntry entry(String id)
    • visibleCategories

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

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

      @Nullable public @Nullable GuideBook.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 '=='.
      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.ResourceLocation 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.ResourceLocation 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

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

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

      public GuideBook.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 GuideBook.PageTurn pageTurn()
      Returns the value of the pageTurn record component.
      Returns:
      the value of the pageTurn record component
    • reveal

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

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

      public GuideBook.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 GuideBook.Handling handling()
      Returns the value of the handling record component.
      Returns:
      the value of the handling record component
    • colors

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

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

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

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

      public Map<String,GuideEntry> 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,GuideBook.Location> itemIndex()
      Returns the value of the itemIndex record component.
      Returns:
      the value of the itemIndex record component