Class CoverMarkers
java.lang.Object
net.ixdarklord.folios.internal.client.CoverMarkers
Where a book model wants its cover lettering, marked in the model itself: an element whose name has
#title
in it is where the book's name goes, one with #subtitle where its subtitle goes, one with #summary
where its summary goes (a book with a summary has its subtitle under its name instead; one without has its subtitle
where the summary would go, if nothing marks a subtitle) (in Blockbench, rename the
cube; a plate, or an invisible box, either works). The line is centred on the element's front (+z) face, as wide as
most of it, as tall as about half of it, and lies just over it. A model's parents are followed for its elements.
Read once per model, until resources reload.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRULE: a soft rule with a diamond stud at its middle, its line's size its thickness, its width its length.static final recordWhat is lettered where: the book's name, its subtitle, its summary (up tolineslines), each its own colour.static final recordA marked line: where and how large, and the z of the face it lies on.static final recordWhat a model marks; either may be null.static final recordA lettering's rows of text and how large:scalemodel units to a font pixel,topthe first row's y. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()static intcolor(CoverMarkers.Kind kind, int gilt, int cover) A lettering's colour: the name in gilt, the subtitle and summary quieter, toward the cover.static List<CoverMarkers.Lettering> layout(GuideBook book, CoverMarkers.Markers marked, GuideBook.CoverText.Line titleDefault, GuideBook.CoverText.Line lowerDefault, float z) A book's cover lettering, where the book says, else where the model marks it, else at the given defaults: its name; its subtitle under the name on the same plate when it has a summary (the summary on the lower plate), or on the lower plate when it hasn't.static CoverMarkers.Markersof(net.minecraft.resources.Identifier model) The markers of a block or item model (its id as in "parent":folios:item/guide_book_3d).static @Nullable CoverMarkers.KindplateAt(CoverMarkers.Markers marked, float x, float y) The plate of a cover a point is on, in the item's units (3 to 13 across, 1 to 15 up):CoverMarkers.Kind.TITLEfor the name's,CoverMarkers.Kind.SUMMARYfor the lower one (whatever it holds), or null off both or where nothing is marked.static List<net.minecraft.network.chat.Component> plateText(GuideBook book, CoverMarkers.Kind plate) What a plate of a book's cover says, aslayout(GuideBook, CoverMarkers.Markers, GuideBook.CoverText.Line, GuideBook.CoverText.Line, float)letters it: on the name's plate the name, with the subtitle under it when the lower plate holds the summary; on the lower plate the summary, or the subtitle.static CoverMarkers.Rowsrows(net.minecraft.client.gui.Font font, CoverMarkers.Lettering lettering) Lays a lettering out in model units: a font line as tall as its size (rows sharing it when there are more), wrapped at its width at that size, then shrunk to fit across.static float[][]rule(GuideBook.CoverText.Line line) A soft rule's pieces, in model units about its middle: {x0, x1, alpha} runs of its line, fading out to its ends, then the stud's half size.static List<net.minecraft.util.FormattedCharSequence> wrap(net.minecraft.client.gui.Font font, CoverMarkers.Lettering lettering, int room) A lettering's text as lines no wider thanroomat size 1 (font pixels), at most its line count, the last cut short with an ellipsis if more is left.
-
Method Details
-
layout
public static List<CoverMarkers.Lettering> layout(GuideBook book, CoverMarkers.Markers marked, GuideBook.CoverText.Line titleDefault, GuideBook.CoverText.Line lowerDefault, float z) A book's cover lettering, where the book says, else where the model marks it, else at the given defaults: its name; its subtitle under the name on the same plate when it has a summary (the summary on the lower plate), or on the lower plate when it hasn't.zis used where nothing is marked. -
color
A lettering's colour: the name in gilt, the subtitle and summary quieter, toward the cover. -
rule
A soft rule's pieces, in model units about its middle: {x0, x1, alpha} runs of its line, fading out to its ends, then the stud's half size. -
rows
public static CoverMarkers.Rows rows(net.minecraft.client.gui.Font font, CoverMarkers.Lettering lettering) Lays a lettering out in model units: a font line as tall as its size (rows sharing it when there are more), wrapped at its width at that size, then shrunk to fit across. -
wrap
public static List<net.minecraft.util.FormattedCharSequence> wrap(net.minecraft.client.gui.Font font, CoverMarkers.Lettering lettering, int room) A lettering's text as lines no wider thanroomat size 1 (font pixels), at most its line count, the last cut short with an ellipsis if more is left. -
clear
public static void clear() -
of
The markers of a block or item model (its id as in "parent":folios:item/guide_book_3d). -
plateAt
The plate of a cover a point is on, in the item's units (3 to 13 across, 1 to 15 up):CoverMarkers.Kind.TITLEfor the name's,CoverMarkers.Kind.SUMMARYfor the lower one (whatever it holds), or null off both or where nothing is marked. -
plateText
public static List<net.minecraft.network.chat.Component> plateText(GuideBook book, CoverMarkers.Kind plate) What a plate of a book's cover says, aslayout(GuideBook, CoverMarkers.Markers, GuideBook.CoverText.Line, GuideBook.CoverText.Line, float)letters it: on the name's plate the name, with the subtitle under it when the lower plate holds the summary; on the lower plate the summary, or the subtitle.
-