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 readType, 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
-
value
The field for thevaluerecord component. -
TYPED_CODEC
-
CODEC
-
-
Constructor Details
-
GameRuleUpdate
-
-
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 readType, T value) -
toString
-
hashCode
-
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
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-