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/Weighted
intermediary net/minecraft/class_6010
official bvs
named value
intermediary comp_2542
official a
named weight
intermediary comp_2543
official 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 boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.<U> Weighted
<U> value()
Returns the value of thevalue
record component.int
weight()
Returns the value of theweight
record component.
-
Field Details
-
value
The field for thevalue
record component. -
weight
private final int weightThe field for theweight
record component. -
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGER
Lnet/minecraft/util/collection/Weighted;LOGGER:Lorg/slf4j/Logger;
intermediary field_55645
Lnet/minecraft/class_6010;field_55645:Lorg/slf4j/Logger;
official c
Lbvs;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 createCodec
Lnet/minecraft/util/collection/Weighted;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
Lbvs;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 createCodec
Lnet/minecraft/util/collection/Weighted;createCodec(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
Lbvs;a(Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec;
-
transform
- Mappings:
Namespace Name Mixin selector named transform
Lnet/minecraft/util/collection/Weighted;transform(Ljava/util/function/Function;)Lnet/minecraft/util/collection/Weighted;
intermediary method_68255
Lnet/minecraft/class_6010;method_68255(Ljava/util/function/Function;)Lnet/minecraft/class_6010;
official a
Lbvs;a(Ljava/util/function/Function;)Lbvs;
-
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 thevalue
record component.- Returns:
- the value of the
value
record component
-
weight
public int weight()Returns the value of theweight
record component.- Returns:
- the value of the
weight
record component
-