Package net.minecraft.util.collection
Record Class Weighted<T>
java.lang.Object
java.lang.Record
net.minecraft.util.collection.Weighted<T>
- Record Components:
value-weight-
A data value with an associated weight. Weighted values are used in
pools.
- Mappings:
Namespace Name named net/minecraft/util/collection/Weightedintermediary net/minecraft/class_6010official btlnamed valueintermediary comp_2542official anamed weightintermediary comp_2543official b
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> com.mojang.serialization.Codec<Weighted<E>> createCodec(com.mojang.serialization.Codec<E> dataCodec) static <E> com.mojang.serialization.Codec<Weighted<E>> createCodec(com.mojang.serialization.MapCodec<E> dataCodec) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.<U> Weighted<U> value()Returns the value of thevaluerecord component.intweight()Returns the value of theweightrecord component.
-
Field Details
-
value
The field for thevaluerecord component. -
weight
private final int weightThe field for theweightrecord component. -
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/util/collection/Weighted;LOGGER:Lorg/slf4j/Logger;intermediary field_55645Lnet/minecraft/class_6010;field_55645:Lorg/slf4j/Logger;official cLbtl;c:Lorg/slf4j/Logger;
-
-
Constructor Details
-
Method Details
-
createCodec
public static <E> com.mojang.serialization.Codec<Weighted<E>> createCodec(com.mojang.serialization.Codec<E> dataCodec) - Mappings:
Namespace Name Mixin selector named createCodecLnet/minecraft/util/collection/Weighted;createCodec(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;intermediary method_34981Lnet/minecraft/class_6010;method_34981(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;official aLbtl;a(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
-
createCodec
public static <E> com.mojang.serialization.Codec<Weighted<E>> createCodec(com.mojang.serialization.MapCodec<E> dataCodec) - Mappings:
Namespace Name Mixin selector named createCodecLnet/minecraft/util/collection/Weighted;createCodec(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;intermediary method_66211Lnet/minecraft/class_6010;method_66211(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;official aLbtl;a(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;
-
transform
- Mappings:
Namespace Name Mixin selector named transformLnet/minecraft/util/collection/Weighted;transform(Ljava/util/function/Function;)Lnet/minecraft/util/collection/Weighted;intermediary method_68255Lnet/minecraft/class_6010;method_68255(Ljava/util/function/Function;)Lnet/minecraft/class_6010;official aLbtl;a(Ljava/util/function/Function;)Lbtl;
-
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 '=='. -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-