Record Class Present<T>

java.lang.Object
java.lang.Record
net.minecraft.util.collection.Present<T>
Record Components:
value -
getWeight -

public record Present<T>(T value, int getWeight) extends Record
Mappings:
Namespace Name
named net/minecraft/util/collection/Present
intermediary net/minecraft/class_6010
official bri
named value
intermediary comp_2542
official a
named getWeight
intermediary comp_2543
official b
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Logger
     
    private final int
    The field for the getWeight record component.
    private final T
    The field for the value record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Present(T data, int int2)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E> com.mojang.serialization.Codec<Present<E>>
    createCodec(com.mojang.serialization.Codec<E> dataCodec)
     
    final boolean
    equals(Object object)
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the getWeight record component.
    final int
    Returns a hash code value for this object.
    static <E> com.mojang.serialization.Codec<Present<E>>
    method_66211(com.mojang.serialization.MapCodec<E> mapCodec)
     
    final String
    Returns a string representation of this record class.
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • value

      private final T value
      The field for the value record component.
    • getWeight

      private final int getWeight
      The field for the getWeight record component.
    • field_55645

      private static final Logger field_55645
      Mappings:
      Namespace Name Mixin selector
      named field_55645 Lnet/minecraft/util/collection/Present;field_55645:Lorg/slf4j/Logger;
      intermediary field_55645 Lnet/minecraft/class_6010;field_55645:Lorg/slf4j/Logger;
      official c Lbri;c:Lorg/slf4j/Logger;
  • Constructor Details

    • Present

      public Present(T data, int int2)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/collection/Present;<init>(Ljava/lang/Object;I)V
      intermediary <init> Lnet/minecraft/class_6010;<init>(Ljava/lang/Object;I)V
      official <init> Lbri;<init>(Ljava/lang/Object;I)V
  • Method Details

    • createCodec

      public static <E> com.mojang.serialization.Codec<Present<E>> createCodec(com.mojang.serialization.Codec<E> dataCodec)
      Mappings:
      Namespace Name Mixin selector
      named createCodec Lnet/minecraft/util/collection/Present;createCodec(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      intermediary method_34981 Lnet/minecraft/class_6010;method_34981(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      official a Lbri;a(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
    • method_66211

      public static <E> com.mojang.serialization.Codec<Present<E>> method_66211(com.mojang.serialization.MapCodec<E> mapCodec)
      Mappings:
      Namespace Name Mixin selector
      named method_66211 Lnet/minecraft/util/collection/Present;method_66211(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;
      intermediary method_66211 Lnet/minecraft/class_6010;method_66211(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;
      official a Lbri;a(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;
    • 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 object)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • value

      public T value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • getWeight

      public int getWeight()
      Returns the value of the getWeight record component.
      Returns:
      the value of the getWeight record component