Record Class GuideLock
java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.GuideLock
public record GuideLock(@Nullable net.minecraft.resources.Identifier advancement, @Nullable String flag, 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:
"advancement": "mymod:story/found_ore": open once that advancement is done;"flag": "mymod:hard_mode": open while that flag, set by code (Guides.setFlag(String, BooleanSupplier)), is on; a leading!reverses it;"secret": true: left out until it opens, where it would otherwise be shown locked.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.resources.IdentifierReturns the value of theadvancementrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Stringflag()Returns the value of theflagrecord component.final inthashCode()Returns a hash code value for this object.booleanisOpen()booleanWhether it is shown at all: open, or locked but not secret.static GuideLockread(com.google.gson.JsonObject json) booleansecret()Returns the value of thesecretrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
-
Constructor Details
-
GuideLock
public GuideLock(@Nullable net.minecraft.resources.Identifier advancement, @Nullable String flag, boolean secret) Creates an instance of aGuideLockrecord class.- Parameters:
advancement- the value for theadvancementrecord componentflag- the value for theflagrecord componentsecret- the value for thesecretrecord component
-
-
Method Details
-
read
-
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. -
advancement
public @Nullable net.minecraft.resources.Identifier advancement()Returns the value of theadvancementrecord component.- Returns:
- the value of the
advancementrecord component
-
flag
Returns the value of theflagrecord component.- Returns:
- the value of the
flagrecord component
-
secret
public boolean secret()Returns the value of thesecretrecord component.- Returns:
- the value of the
secretrecord component
-