From 3c28020accfc58b371a7c442ed86b7fab0fae0cf Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Thu, 9 Jan 2025 20:01:44 +0200 Subject: [PATCH] Map pool and weighting stuff (#4083) --- .../minecraft/util/collection/Pool.mapping | 22 +++++++++++++++++++ .../{Present.mapping => Weighted.mapping} | 7 +++--- .../util/collection/Weighting.mapping | 4 ++++ 3 files changed, 29 insertions(+), 4 deletions(-) rename mappings/net/minecraft/util/collection/{Present.mapping => Weighted.mapping} (73%) diff --git a/mappings/net/minecraft/util/collection/Pool.mapping b/mappings/net/minecraft/util/collection/Pool.mapping index 654a2515d1..8924487b88 100644 --- a/mappings/net/minecraft/util/collection/Pool.mapping +++ b/mappings/net/minecraft/util/collection/Pool.mapping @@ -1,6 +1,8 @@ CLASS net/minecraft/class_6012 net/minecraft/util/collection/Pool FIELD field_29934 totalWeight I FIELD field_29935 entries Ljava/util/List; + FIELD field_55646 FLATTENED_CONTENT_THRESHOLD I + FIELD field_55647 content Lnet/minecraft/class_6012$class_10581; METHOD (Ljava/util/List;)V ARG 1 entries METHOD equals (Ljava/lang/Object;)Z @@ -16,9 +18,29 @@ CLASS net/minecraft/class_6012 net/minecraft/util/collection/Pool ARG 1 random METHOD method_34993 isEmpty ()Z METHOD method_34994 getEntries ()Ljava/util/List; + METHOD method_66213 createCodec (Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec; + ARG 0 entryCodec METHOD method_66214 of (Ljava/lang/Object;)Lnet/minecraft/class_6012; ARG 0 entry METHOD method_66215 builder ()Lnet/minecraft/class_6012$class_6006; + METHOD method_66216 get (Lnet/minecraft/class_5819;)Ljava/lang/Object; + ARG 1 random + METHOD method_66217 createNonEmptyCodec (Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec; + ARG 0 entryCodec + METHOD method_66218 createNonEmptyCodec (Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec; + ARG 0 entryCodec + CLASS class_10579 WrappedContent + FIELD field_55648 entries [Lnet/minecraft/class_6010; + METHOD (Ljava/util/List;)V + ARG 1 entries + CLASS class_10580 FlattenedContent + FIELD field_55649 entries [Ljava/lang/Object; + METHOD (Ljava/util/List;I)V + ARG 1 entries + ARG 2 totalWeight + CLASS class_10581 Content + METHOD method_66219 get (I)Ljava/lang/Object; + ARG 1 i CLASS class_6006 Builder FIELD field_29926 entries Lcom/google/common/collect/ImmutableList$Builder; METHOD method_34974 build ()Lnet/minecraft/class_6012; diff --git a/mappings/net/minecraft/util/collection/Present.mapping b/mappings/net/minecraft/util/collection/Weighted.mapping similarity index 73% rename from mappings/net/minecraft/util/collection/Present.mapping rename to mappings/net/minecraft/util/collection/Weighted.mapping index 5f7bc49d92..201a1bdb1f 100644 --- a/mappings/net/minecraft/util/collection/Present.mapping +++ b/mappings/net/minecraft/util/collection/Weighted.mapping @@ -1,9 +1,8 @@ -CLASS net/minecraft/class_6010 net/minecraft/util/collection/Present - FIELD comp_2543 getWeight I +CLASS net/minecraft/class_6010 net/minecraft/util/collection/Weighted + COMMENT A data value with an associated weight. Weighted values are used in + COMMENT {@linkplain Pool pools}. FIELD field_55645 LOGGER Lorg/slf4j/Logger; METHOD (Ljava/lang/Object;I)V - ARG 1 data - METHOD comp_2543 getWeight ()I METHOD method_34981 createCodec (Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec; ARG 0 dataCodec METHOD method_66211 createCodec (Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/Codec; diff --git a/mappings/net/minecraft/util/collection/Weighting.mapping b/mappings/net/minecraft/util/collection/Weighting.mapping index 17e360f388..4bd7100307 100644 --- a/mappings/net/minecraft/util/collection/Weighting.mapping +++ b/mappings/net/minecraft/util/collection/Weighting.mapping @@ -1,13 +1,17 @@ CLASS net/minecraft/class_6011 net/minecraft/util/collection/Weighting METHOD method_34984 getWeightSum (Ljava/util/List;Ljava/util/function/ToIntFunction;)I ARG 0 pool + ARG 1 weightGetter METHOD method_34985 getAt (Ljava/util/List;ILjava/util/function/ToIntFunction;)Ljava/util/Optional; ARG 0 pool ARG 1 totalWeight + ARG 2 weightGetter METHOD method_34986 getRandom (Lnet/minecraft/class_5819;Ljava/util/List;Ljava/util/function/ToIntFunction;)Ljava/util/Optional; ARG 0 random ARG 1 pool + ARG 2 weightGetter METHOD method_34987 getRandom (Lnet/minecraft/class_5819;Ljava/util/List;ILjava/util/function/ToIntFunction;)Ljava/util/Optional; ARG 0 random ARG 1 pool ARG 2 totalWeight + ARG 3 weightGetter