Record Class EnvironmentAttributeMap.Entry<Value,Argument>

java.lang.Object
java.lang.Record
net.minecraft.world.attribute.EnvironmentAttributeMap.Entry<Value,Argument>
Enclosing class:
EnvironmentAttributeMap

public static record EnvironmentAttributeMap.Entry<Value,Argument>(Argument argument, AttributeModifier<Value,Argument> modifier) extends Record
  • Field Details

    • argument

      private final Argument argument
      The field for the argument record component.
    • modifier

      private final AttributeModifier<Value,Argument> modifier
      The field for the modifier record component.
  • Constructor Details

    • Entry

      public Entry(Argument argument, AttributeModifier<Value,Argument> modifier)
      Creates an instance of a Entry record class.
      Parameters:
      argument - the value for the argument record component
      modifier - the value for the modifier record component
  • Method Details

    • createCodec

      private static <Value> com.mojang.serialization.Codec<EnvironmentAttributeMap.Entry<Value,?>> createCodec(EnvironmentAttribute<Value> pAttribute)
    • createFullCodec

      private static <Value, Argument> com.mojang.serialization.MapCodec<EnvironmentAttributeMap.Entry<Value,Argument>> createFullCodec(EnvironmentAttribute<Value> pAttribute, AttributeModifier<Value,Argument> pModifier)
    • applyModifier

      public Value applyModifier(Value pValue)
    • 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.
    • argument

      public Argument argument()
      Returns the value of the argument record component.
      Returns:
      the value of the argument record component
    • modifier

      public AttributeModifier<Value,Argument> modifier()
      Returns the value of the modifier record component.
      Returns:
      the value of the modifier record component