Record Class GameRule.Int
java.lang.Object
java.lang.Record
org.geysermc.geyser.level.gamerule.GameRule.Int
public static record GameRule.Int(net.kyori.adventure.key.Key key, GameRuleCategory category, Integer defaultValue, int max, int min)
extends Record
implements GameRule<Integer>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.geysermc.geyser.level.gamerule.GameRule
GameRule.Bool, GameRule.Int -
Constructor Summary
ConstructorsConstructorDescriptionInt(String key, GameRuleCategory category, Integer defaultValue, int max, int min) Int(net.kyori.adventure.key.Key key, GameRuleCategory category, Integer defaultValue, int max, int min) Creates an instance of aIntrecord 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.intmax()Returns the value of themaxrecord component.intmin()Returns the value of theminrecord 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
-
Int
-
Int
public Int(net.kyori.adventure.key.Key key, GameRuleCategory category, Integer defaultValue, int max, int min) Creates an instance of aIntrecord class.- Parameters:
key- the value for thekeyrecord componentcategory- the value for thecategoryrecord componentdefaultValue- the value for thedefaultValuerecord componentmax- the value for themaxrecord componentmin- the value for theminrecord 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<Integer>
-
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 '=='. -
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<Integer>- Returns:
- the value of the
defaultValuerecord component
-
max
public int max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
min
public int min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-