Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map pool and weighting stuff #4083

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions mappings/net/minecraft/util/collection/Pool.mapping
Original file line number Diff line number Diff line change
@@ -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 <init> (Ljava/util/List;)V
ARG 1 entries
METHOD equals (Ljava/lang/Object;)Z
Expand All @@ -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 <init> (Ljava/util/List;)V
ARG 1 entries
CLASS class_10580 FlattenedContent
FIELD field_55649 entries [Ljava/lang/Object;
METHOD <init> (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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <init> (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;
Expand Down
4 changes: 4 additions & 0 deletions mappings/net/minecraft/util/collection/Weighting.mapping
Original file line number Diff line number Diff line change
@@ -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