Package net.ixdarklord.folios.api.client
Record Class FoliosBook.Models
java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.FoliosBook.Models
- Record Components:
item- null for CoolCatLib's own bookopen- null for CoolCatLib's own open bookcover- null for noneguiModel- whether CoolCatLib's book item shows its model in inventory slots rather than its flat icon
- Enclosing class:
FoliosBook
public static record FoliosBook.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
FieldsModifier and TypeFieldDescriptionstatic final FoliosBook.Modelsstatic final net.minecraft.resources.ResourceLocation -
Constructor Summary
ConstructorsConstructorDescriptionModels(@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 aModelsrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.resources.ResourceLocationcover()Returns the value of thecoverrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanguiModel()Returns the value of theguiModelrecord component.booleanhands()Returns the value of thehandsrecord component.final inthashCode()Returns a hash code value for this object.@Nullable net.minecraft.resources.ResourceLocationitem()Returns the value of theitemrecord component.@Nullable net.minecraft.resources.ResourceLocationopen()Returns the value of theopenrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_COVER
public static final net.minecraft.resources.ResourceLocation DEFAULT_COVER -
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 aModelsrecord class.
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
item
@Nullable public @Nullable net.minecraft.resources.ResourceLocation item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
open
@Nullable public @Nullable net.minecraft.resources.ResourceLocation open()Returns the value of theopenrecord component.- Returns:
- the value of the
openrecord component
-
cover
@Nullable public @Nullable net.minecraft.resources.ResourceLocation cover()Returns the value of thecoverrecord component.- Returns:
- the value of the
coverrecord component
-
hands
public boolean hands()Returns the value of thehandsrecord component.- Returns:
- the value of the
handsrecord component
-
guiModel
public boolean guiModel()Returns the value of theguiModelrecord component.- Returns:
- the value of the
guiModelrecord component
-