Class CoverMarkers

java.lang.Object
net.ixdarklord.folios.internal.client.CoverMarkers

public final class CoverMarkers extends Object
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), and one with #icon is the gem the book's cover icon is set in (CoverEmblem; its middle and size, square, turned 45° as a setting is) (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.
  • Method Details

    • layout

      public static List<CoverMarkers.Lettering> layout(FoliosBook book, CoverMarkers.Markers marked, FoliosBook.CoverText.Line titleDefault, FoliosBook.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. z is used where nothing is marked.
    • color

      public static int color(CoverMarkers.Kind kind, int gilt, int cover)
      A lettering's colour: the name in gilt, the subtitle and summary quieter, toward the cover.
    • rule

      public static float[][] rule(FoliosBook.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.
    • 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 than room at 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

      public static CoverMarkers.Markers of(net.minecraft.resources.Identifier model)
      The markers of a block or item model (its id as in "parent": folios:item/guide_book_3d).
    • plateAt

      public static @Nullable CoverMarkers.Kind plateAt(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.TITLE for the name's, CoverMarkers.Kind.SUMMARY for 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(FoliosBook book, CoverMarkers.Kind plate)
      What a plate of a book's cover says, as layout(FoliosBook, CoverMarkers.Markers, FoliosBook.CoverText.Line, FoliosBook.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.
    • side

      public static float side(CoverMarkers.Marked gem)
      How wide a marked gem is, in model units.