Record Class GameRule.Bool

java.lang.Object
java.lang.Record
org.geysermc.geyser.level.gamerule.GameRule.Bool
All Implemented Interfaces:
GameRule<Boolean>
Enclosing interface:
GameRule<T>

public static record GameRule.Bool(net.kyori.adventure.key.Key key, GameRuleCategory category, Boolean defaultValue) extends Record implements GameRule<Boolean>
  • Constructor Details

    • Bool

      public Bool(String key, GameRuleCategory category, Boolean defaultValue)
    • Bool

      public Bool(net.kyori.adventure.key.Key key, GameRuleCategory category, Boolean defaultValue)
      Creates an instance of a Bool record class.
      Parameters:
      key - the value for the key record component
      category - the value for the category record component
      defaultValue - the value for the defaultValue record component
  • Method Details

    • adapter

      public TypeAdapter<Boolean> adapter()
      Description copied from interface: GameRule
      The TypeAdapter used for this gamerule
      Specified by:
      adapter in interface GameRule<Boolean>
    • validate

      public boolean validate(Boolean value)
      Description copied from interface: GameRule
      ensures gamerule values are within range
      Specified by:
      validate in interface GameRule<Boolean>
    • toComponent

      public org.geysermc.cumulus.component.Component toComponent(GeyserSession session, String currentValue)
      Specified by:
      toComponent in interface GameRule<Boolean>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public net.kyori.adventure.key.Key key()
      Returns the value of the key record component.
      Specified by:
      key in interface GameRule<Boolean>
      Returns:
      the value of the key record component
    • category

      public GameRuleCategory category()
      Returns the value of the category record component.
      Specified by:
      category in interface GameRule<Boolean>
      Returns:
      the value of the category record component
    • defaultValue

      public Boolean defaultValue()
      Returns the value of the defaultValue record component.
      Specified by:
      defaultValue in interface GameRule<Boolean>
      Returns:
      the value of the defaultValue record component