Package net.ixdarklord.folios.api.client
Class FoliosObjective
java.lang.Object
net.ixdarklord.folios.api.client.FoliosObjective
A condition the player makes progress on: an objective of a quest page, shown with a bar, and what a lock
(
"requires", FoliosLock) waits for. In JSON it is an object naming what it follows, with an optional
"label" (text with marks, or a translation key) in place of the one it makes for itself:
{"advancement": "minecraft:story/mine_stone"}: done once the advancement is;{"read": "basics/first_steps"}: an entry of the book read;{"read_category": "basics"}: how much of a category has been read;{"read_book": true}: how much of the whole book has been read;{"quest": "basics/first_quest"}: a quest of the book (an entry with quest pages) done; or, written with its namespace ("mymod:first_quest"), one of the server's (data packs'folios/quests);{"flag": "mymod:met_the_wizard"}: a flag set in code (FoliosGuides.setFlag(java.lang.String, java.util.function.BooleanSupplier); a leading!reverses it);{"carried": "minecraft:diamond", "goal": 5}: items carried now (an item, a#tagor a list);{"obtained": "minecraft:diamond"}: done once any of these items has been in the inventory, whatever became of it after;{"source": "mymod:mana", "goal": 100}: a value a mod reports (FoliosObjectives.register(net.minecraft.resources.ResourceLocation, net.ixdarklord.folios.api.client.FoliosObjectives.Source)), done when it reaches the goal;{"any": [{...}, {...}]}: done once any one of these is.
"hidden": true shows it as ??? until it is done.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintgoal()How many it counts to: a count of items carried, or a source's value; 1 for the rest.static List<FoliosObjective>inOrder(List<FoliosObjective> objectives) These objectives, each counting only once all before it are done (a quest's"in_order").booleanWhether it is done or not done, with nothing between: no bar of its own is shown for it.booleanisDone(FoliosBook book) booleanisWaiting(FoliosBook book) Whether it waits on others before it counts (an objective of an"in_order"quest after one not done).@Nullable FoliosStackitems()The items it counts, for an icon; null for objectives that aren't about items.com.google.gson.JsonObjectjson()The JSON it was read from, for writing it back.net.minecraft.network.chat.Componentlabel(FoliosBook book) What it says, with how far along it is where that is a count;???while it is hidden and not done.obtained()The items"obtained"conditions ask for, this one's and any it holds ("any").floatprogress(FoliosBook book) How far along it is, 0 to 1.static floatprogress(FoliosBook book, List<FoliosObjective> objectives) How far along several objectives are together: the average of each.static FoliosObjectiveread(com.google.gson.JsonObject json) A condition as JSON writes it.static List<FoliosObjective>readAll(com.google.gson.JsonElement json) One condition, or a list of them all of which must hold.
-
Field Details
-
CODEC
-
-
Method Details
-
read
A condition as JSON writes it. -
readAll
One condition, or a list of them all of which must hold. -
inOrder
These objectives, each counting only once all before it are done (a quest's"in_order"). -
progress
How far along it is, 0 to 1. -
isDone
-
isWaiting
Whether it waits on others before it counts (an objective of an"in_order"quest after one not done). -
goal
public int goal()How many it counts to: a count of items carried, or a source's value; 1 for the rest. -
isAllOrNothing
public boolean isAllOrNothing()Whether it is done or not done, with nothing between: no bar of its own is shown for it. -
label
What it says, with how far along it is where that is a count;???while it is hidden and not done. -
items
The items it counts, for an icon; null for objectives that aren't about items. -
obtained
The items"obtained"conditions ask for, this one's and any it holds ("any"). -
progress
How far along several objectives are together: the average of each. -
json
public com.google.gson.JsonObject json()The JSON it was read from, for writing it back.
-