Class GuidePageTypes

java.lang.Object
net.ixdarklord.folios.api.client.page.GuidePageTypes

public final class GuidePageTypes extends Object
The types of element a page shows, by the "type" their JSON names. A type without a namespace is Folios's: "text" is folios:text.

A page is a title and its "elements", set one under another, each with its own title and text if it has them (a plain string is a text element); one that doesn't fit in what is left of the page starts the next, and text runs on. A page written as one element ({"type": "recipe", ...}) is a page of that element alone, and a page's own "text" comes before its elements:

{"title": "Torches", "elements": ["Light the way:", {"type": "recipe", "recipe": "minecraft:torch"}, {"type": "build", "build": "tower"}]}
Built in:
  • text: title, text; as a page, elements.
  • spotlight: an item shown large (item, see GuideStack), title, text.
  • image: images (texture paths, shown in turn), title, text, border.
  • recipe: recipe or recipes (up to two ids), title, text; crafting, smelting, stonecutting and smithing recipes are drawn as such.
  • entity: entity (a type id), scale, offset, spin, title, text.
  • multiblock: a structure from pattern (layers top to bottom, each a list of rows) and mapping (character to block state, or to a tag of blocks any of which will do, "#minecraft:logs", shown in turn), title, text. Each block is counted by the items it takes: a door's or a bed's second half comes with the first, and a double slab is two.
  • structure: structures from data packs (data/<namespace>/structure/<path>.nbt), asked of the server: structure or structures (ids, or {"id": ..., "name": ...}), selector ("arrows", the default, or "numbers") to pick between several, height, title, text. Shown to look at: no list of blocks, nor a clasp to build it in the world.
  • build: builds designed in the book's own files (<book>/builds/<name>.json: a name, a pattern and mapping as a multiblock page's, and blocks, each {"block": ..., "pos": [x, y, z]} or a box {"block": ..., "from": [...], "to": [...], "hollow": true}, in order, air clearing): build or builds (a bare name for this book's, namespace:path for any book's file under folios/), and the rest as a structure page.
  • links: links (entry ids, or {"entry": ..., "label": ...}), title, text.
  • quest: objectives (see GuideObjective), title, text, reward: a checklist with progress bars, live as the player plays; its entry shows its progress on its row, and a toast says when it is done.
And two that are pages of their own, never elements: spread (one thing over both pages of the open book) and empty (nothing, to start what follows on a new spread). An element type of a mod's own can be in a page's elements when it lays itself out through GuideLayout.flow(String, int, String, GuidePage.Part). Every page may also have "icon" (shown before its title; an entry's first page shows the entry's icon unless it names its own or "none"), "anchor" (a name links can reach it by, entry:id#anchor) and the fields of a GuideLock.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable com.mojang.serialization.MapCodec<? extends GuidePage>
    get(net.minecraft.resources.Identifier type)
     
    static net.minecraft.resources.Identifier
    id(String written)
    A page type as written: a bare name is CoolCatLib's.
    static void
    register(net.minecraft.resources.Identifier type, com.mojang.serialization.MapCodec<? extends GuidePage> codec)
    Adds a type of element (or of page); register it while the client initialises, before resources load.
    static Set<net.minecraft.resources.Identifier>
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • register

      public static void register(net.minecraft.resources.Identifier type, com.mojang.serialization.MapCodec<? extends GuidePage> codec)
      Adds a type of element (or of page); register it while the client initialises, before resources load.
    • get

      public static @Nullable com.mojang.serialization.MapCodec<? extends GuidePage> get(net.minecraft.resources.Identifier type)
    • types

      public static Set<net.minecraft.resources.Identifier> types()
    • id

      public static net.minecraft.resources.Identifier id(String written)
      A page type as written: a bare name is CoolCatLib's.