Class GuidePageTypes
java.lang.Object
net.ixdarklord.folios.api.client.page.GuidePageTypes
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, seeGuideStack),title,text.image:images(texture paths, shown in turn),title,text,border.recipe:recipeorrecipes(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 frompattern(layers top to bottom, each a list of rows) andmapping(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>/structures/<path>.nbt), asked of the server:structureorstructures(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: aname, apatternandmappingas a multiblock page's, andblocks, each{"block": ..., "pos": [x, y, z]}or a box{"block": ..., "from": [...], "to": [...], "hollow": true}, in order, air clearing):buildorbuilds(a bare name for this book's,namespace:pathfor any book's file underfolios/), and the rest as a structure page.links:links(entry ids, or{"entry": ..., "label": ...}),title,text.quest:objectives(seeGuideObjective),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.
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(java.lang.String, int, java.lang.String, net.ixdarklord.folios.api.client.page.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 TypeMethodDescriptionstatic @Nullable com.mojang.serialization.MapCodec<? extends GuidePage>get(net.minecraft.resources.ResourceLocation type) static net.minecraft.resources.ResourceLocationA page type as written: a bare name is CoolCatLib's.static voidregister(net.minecraft.resources.ResourceLocation 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.ResourceLocation>types()
-
Method Details
-
register
public static void register(net.minecraft.resources.ResourceLocation 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
@Nullable public static @Nullable com.mojang.serialization.MapCodec<? extends GuidePage> get(net.minecraft.resources.ResourceLocation type) -
types
-
id
A page type as written: a bare name is CoolCatLib's.
-