Record Class GuideBook.Models

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.GuideBook.Models
Record Components:
item - null for CoolCatLib's own book
open - null for CoolCatLib's own open book
cover - null for none
guiModel - whether CoolCatLib's book item shows its model in inventory slots rather than its flat icon
Enclosing class:
GuideBook

public static record GuideBook.Models(@Nullable net.minecraft.resources.ResourceLocation item, @Nullable net.minecraft.resources.ResourceLocation open, @Nullable net.minecraft.resources.ResourceLocation cover, boolean hands, boolean guiModel) extends Record
The models a book is shown with: "models" in book.json.

 "models": {
   "item":  "mymod:handbook",              // the item model of the book's item (assets/mymod/items/handbook.json)
   "open":  "mymod:handbook_open",         // the item model while its holder reads it, as others see them
   "cover": "mymod:guide/handbook_cover",  // what sits on a handheld book's boards (assets/mymod/models/...); "none" for nothing
   "hands": true,                          // whether the reader's hands are drawn holding a handheld book
   "gui": "flat"                           // in inventory slots: "flat" for the flat icon, "model" for the book's model
 }
 
The open model and the cover are in the format of block and item models. A cover model is laid on each board's outside, mirrored on the left one: x from 0 at the spine to 16 at the board's outer edge, y from 0 at its foot to 16 at its head, z from 0 on the board outwards in the same units as x; faces with a "tintindex" take the book's cover colour. "item_model" beside "models" still works, for the item's.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final GuideBook.Models
     
    static final net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Models(@Nullable net.minecraft.resources.ResourceLocation item, @Nullable net.minecraft.resources.ResourceLocation open, @Nullable net.minecraft.resources.ResourceLocation cover, boolean hands, boolean guiModel)
    Creates an instance of a Models record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.resources.ResourceLocation
    Returns the value of the cover record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the guiModel record component.
    boolean
    Returns the value of the hands record component.
    final int
    Returns a hash code value for this object.
    @Nullable net.minecraft.resources.ResourceLocation
    Returns the value of the item record component.
    @Nullable net.minecraft.resources.ResourceLocation
    Returns the value of the open record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • DEFAULT_COVER

      public static final net.minecraft.resources.ResourceLocation DEFAULT_COVER
    • DEFAULT

      public static final GuideBook.Models DEFAULT
  • Constructor Details

    • Models

      public Models(@Nullable @Nullable net.minecraft.resources.ResourceLocation item, @Nullable @Nullable net.minecraft.resources.ResourceLocation open, @Nullable @Nullable net.minecraft.resources.ResourceLocation cover, boolean hands, boolean guiModel)
      Creates an instance of a Models record class.
      Parameters:
      item - the value for the item record component
      open - the value for the open record component
      cover - the value for the cover record component
      hands - the value for the hands record component
      guiModel - the value for the guiModel record component
  • Method Details

    • 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.
    • item

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

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

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

      public boolean hands()
      Returns the value of the hands record component.
      Returns:
      the value of the hands record component
    • guiModel

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