Record Class FoliosLock
java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.FoliosLock
- Record Components:
book- the book it is in, whose reading its conditions ask about
public record FoliosLock(@Nullable net.minecraft.resources.Identifier book, List<FoliosObjective> requires, boolean secret)
extends Record
What keeps a category, entry or page closed until the player has earned it. In JSON these are fields of the thing
locked:
"requires": a condition, written as a quest objective is (FoliosObjective), or a list of them all of which must hold:"requires": {"advancement": "mymod:story/found_ore"},"requires": [{"read": "basics/first_steps"}, {"obtained": "minecraft:diamond"}];"secret": true: left out until it opens, where it would otherwise be shown locked.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFoliosLock(@Nullable net.minecraft.resources.Identifier book, List<FoliosObjective> requires, boolean secret) Creates an instance of aFoliosLockrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.resources.Identifierbook()Returns the value of thebookrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisOpen()booleanWhether it is shown at all: open, or locked but not secret.static FoliosLockread(com.google.gson.JsonObject json, net.minecraft.resources.Identifier book) The lock an object of a book's JSON (a category, an entry or a page) has.requires()Returns the value of therequiresrecord component.booleansecret()Returns the value of thesecretrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
-
Constructor Details
-
FoliosLock
public FoliosLock(@Nullable net.minecraft.resources.Identifier book, List<FoliosObjective> requires, boolean secret) Creates an instance of aFoliosLockrecord class.- Parameters:
book- the value for thebookrecord componentrequires- the value for therequiresrecord componentsecret- the value for thesecretrecord component
-
-
Method Details
-
read
public static FoliosLock read(com.google.gson.JsonObject json, net.minecraft.resources.Identifier book) The lock an object of a book's JSON (a category, an entry or a page) has. -
isOpen
public boolean isOpen() -
isVisible
public boolean isVisible()Whether it is shown at all: open, or locked but not secret. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
book
-
requires
Returns the value of therequiresrecord component.- Returns:
- the value of the
requiresrecord component
-
secret
public boolean secret()Returns the value of thesecretrecord component.- Returns:
- the value of the
secretrecord component
-