Package net.ixdarklord.folios.api.client
Record Class GuideLock
java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.GuideLock
public record GuideLock(@Nullable net.minecraft.resources.ResourceLocation 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(java.lang.String, java.util.function.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.ResourceLocationReturns 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 @Nullable net.minecraft.resources.ResourceLocation advancement, @Nullable @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
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
advancement
@Nullable public @Nullable net.minecraft.resources.ResourceLocation 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
-