Record Class GameRule.Bool
java.lang.Object
java.lang.Record
org.geysermc.geyser.level.gamerule.GameRule.Bool
public static record GameRule.Bool(net.kyori.adventure.key.Key key, GameRuleCategory category, Boolean defaultValue)
extends Record
implements GameRule<Boolean>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.geysermc.geyser.level.gamerule.GameRule
GameRule.Bool, GameRule.Int -
Constructor Summary
ConstructorsConstructorDescriptionBool(String key, GameRuleCategory category, Boolean defaultValue) Bool(net.kyori.adventure.key.Key key, GameRuleCategory category, Boolean defaultValue) Creates an instance of aBoolrecord class. -
Method Summary
Modifier and TypeMethodDescriptionadapter()TheTypeAdapterused for this gamerulecategory()Returns the value of thecategoryrecord component.Returns the value of thedefaultValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.kyori.adventure.key.Keykey()Returns the value of thekeyrecord component.org.geysermc.cumulus.component.ComponenttoComponent(GeyserSession session, String currentValue) final StringtoString()Returns a string representation of this record class.booleanensures gamerule values are within range
-
Constructor Details
-
Bool
-
Bool
Creates an instance of aBoolrecord class.- Parameters:
key- the value for thekeyrecord componentcategory- the value for thecategoryrecord componentdefaultValue- the value for thedefaultValuerecord component
-
-
Method Details
-
adapter
Description copied from interface:GameRuleTheTypeAdapterused for this gamerule -
validate
Description copied from interface:GameRuleensures gamerule values are within range -
toComponent
public org.geysermc.cumulus.component.Component toComponent(GeyserSession session, String currentValue) - Specified by:
toComponentin interfaceGameRule<Boolean>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
key
public net.kyori.adventure.key.Key key()Returns the value of thekeyrecord component. -
category
Returns the value of thecategoryrecord component. -
defaultValue
Returns the value of thedefaultValuerecord component.- Specified by:
defaultValuein interfaceGameRule<Boolean>- Returns:
- the value of the
defaultValuerecord component
-