Record Class GameRulesService.GameRuleUpdate<T>
java.lang.Object
java.lang.Record
net.minecraft.server.jsonrpc.methods.GameRulesService.GameRuleUpdate<T>
- Enclosing class:
GameRulesService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<GameRulesService.GameRuleUpdate<?>> The field for thegameRulerecord component.static final com.mojang.serialization.Codec<GameRulesService.GameRuleUpdate<?>> private final TThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGameRuleUpdate(GameRule<T> gameRule, T value) Creates an instance of aGameRuleUpdaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.gameRule()Returns the value of thegameRulerecord component.private static <T> GameRulesService.GameRuleUpdate<T> getUntypedRule(GameRule<T> gameRule, GameRuleType type, T value) private static <T> com.mojang.serialization.MapCodec<? extends GameRulesService.GameRuleUpdate<T>> getValueAndTypeCodec(GameRule<T> gameRule) private static <T> com.mojang.serialization.MapCodec<? extends GameRulesService.GameRuleUpdate<T>> getValueCodec(GameRule<T> gameRule) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Field Details
-
gameRule
The field for thegameRulerecord component. -
value
The field for thevaluerecord component. -
TYPED_CODEC
-
CODEC
-
-
Constructor Details
-
GameRuleUpdate
Creates an instance of aGameRuleUpdaterecord class.- Parameters:
gameRule- the value for thegameRulerecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
getValueCodec
private static <T> com.mojang.serialization.MapCodec<? extends GameRulesService.GameRuleUpdate<T>> getValueCodec(GameRule<T> gameRule) -
getValueAndTypeCodec
private static <T> com.mojang.serialization.MapCodec<? extends GameRulesService.GameRuleUpdate<T>> getValueAndTypeCodec(GameRule<T> gameRule) -
getUntypedRule
private static <T> GameRulesService.GameRuleUpdate<T> getUntypedRule(GameRule<T> gameRule, GameRuleType type, T value) -
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). -
gameRule
Returns the value of thegameRulerecord component.- Returns:
- the value of the
gameRulerecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-