Skip to content

Commit

Permalink
23w40a util
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j committed Oct 5, 2023
1 parent b2526c6 commit 9fc2409
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 1 deletion.
32 changes: 31 additions & 1 deletion mappings/net/minecraft/util/StringIdentifiable.mapping
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CLASS net/minecraft/class_3542 net/minecraft/util/StringIdentifiable
COMMENT An interface, implemented by enums, that allows the enum to be serialized
COMMENT An interface, usually implemented by enums, that allows the object to be serialized
COMMENT by codecs. An instance is identified using a string.
COMMENT
COMMENT @apiNote To make an enum serializable with codecs, implement this on the enum class,
Expand All @@ -23,6 +23,21 @@ CLASS net/minecraft/class_3542 net/minecraft/util/StringIdentifiable
COMMENT and a given decode function.
ARG 0 enumValues
ARG 1 valueNameTransformer
METHOD method_53949 (Lnet/minecraft/class_3542;)Lnet/minecraft/class_3542;
ARG 0 value
METHOD method_53950 (Ljava/lang/String;)Ljava/lang/String;
ARG 0 valueName
METHOD method_53951 (Ljava/util/Map;Ljava/lang/String;)Lnet/minecraft/class_3542;
ARG 1 name
METHOD method_53952 (Ljava/util/function/Function;Lnet/minecraft/class_3542;)Ljava/lang/String;
ARG 1 value
METHOD method_53953 createMapper ([Lnet/minecraft/class_3542;Ljava/util/function/Function;)Ljava/util/function/Function;
ARG 0 values
ARG 1 valueNameTransformer
METHOD method_53954 ([Lnet/minecraft/class_3542;Ljava/util/function/Function;Ljava/lang/String;)Lnet/minecraft/class_3542;
ARG 2 name
METHOD method_53955 createBasicCodec (Ljava/util/function/Supplier;)Lcom/mojang/serialization/Codec;
ARG 0 values
CLASS 1
METHOD keys (Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;
ARG 1 ops
Expand All @@ -38,3 +53,18 @@ CLASS net/minecraft/class_3542 net/minecraft/util/StringIdentifiable
METHOD method_47920 byId (Ljava/lang/String;Ljava/lang/Enum;)Ljava/lang/Enum;
ARG 1 id
ARG 2 fallback
CLASS class_8808 BasicCodec
FIELD field_46245 codec Lcom/mojang/serialization/Codec;
METHOD <init> ([Lnet/minecraft/class_3542;Ljava/util/function/Function;Ljava/util/function/ToIntFunction;)V
ARG 1 values
ARG 2 idToIdentifiable
ARG 3 identifiableToOrdinal
METHOD decode (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 ops
ARG 2 input
METHOD encode (Ljava/lang/Object;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 input
ARG 2 ops
ARG 3 prefix
METHOD method_53957 ([Lnet/minecraft/class_3542;I)Lnet/minecraft/class_3542;
ARG 1 ordinal
2 changes: 2 additions & 0 deletions mappings/net/minecraft/util/UserCache.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ CLASS net/minecraft/class_3312 net/minecraft/util/UserCache
METHOD method_37157 setExecutor (Ljava/util/concurrent/Executor;)V
ARG 1 executor
METHOD method_39753 clearExecutor ()V
METHOD method_53912 getOfflinePlayerProfile (Ljava/lang/String;)Ljava/util/Optional;
ARG 0 name
CLASS 1
METHOD onProfileLookupFailed (Ljava/lang/String;Ljava/lang/Exception;)V
ARG 2 exception
Expand Down
11 changes: 11 additions & 0 deletions mappings/net/minecraft/util/Util.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ CLASS net/minecraft/class_156 net/minecraft/util/Util
COMMENT
COMMENT @implNote Unlike {@link java.util.List#lastIndexOf}, the returned function will
COMMENT return {@code 0} when given values not in the passed list.
COMMENT
COMMENT @see #lastIdentityIndexGetter
ARG 0 values
METHOD method_44893 getFormattedCurrentTime ()Ljava/lang/String;
COMMENT {@return the current time formatted using {@link #DATE_TIME_FORMATTER}}
Expand All @@ -298,6 +300,15 @@ CLASS net/minecraft/class_156 net/minecraft/util/Util
COMMENT {@return whether {@code string} is {@code null}, empty, or composed entirely
COMMENT of {@linkplain #isWhitespace} spaces}
ARG 0 string
METHOD method_53909 lastIdentityIndexGetter (Ljava/util/List;)Ljava/util/function/ToIntFunction;
COMMENT {@return a function that, when given a value in {@code values}, returns the last
COMMENT index of the value in the list using identity comparison}
COMMENT
COMMENT @implNote Unlike {@link java.util.List#lastIndexOf}, the returned function will
COMMENT return {@code 0} when given values not in the passed list.
COMMENT
COMMENT @see #lastIndexGetter
ARG 0 values
METHOD method_645 previous (Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
COMMENT {@return the item preceding {@code object} in {@code iterable}}
COMMENT
Expand Down
9 changes: 9 additions & 0 deletions mappings/net/minecraft/util/Uuids.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CLASS net/minecraft/class_4844 net/minecraft/util/Uuids
FIELD field_39211 BYTE_ARRAY_SIZE I
FIELD field_40825 CODEC Lcom/mojang/serialization/Codec;
FIELD field_41525 STRING_CODEC Lcom/mojang/serialization/Codec;
FIELD field_46588 STRICT_CODEC Lcom/mojang/serialization/Codec;
METHOD method_26274 toIntArray (JJ)[I
ARG 0 uuidMost
ARG 2 uuidLeast
Expand Down Expand Up @@ -31,3 +32,11 @@ CLASS net/minecraft/class_4844 net/minecraft/util/Uuids
ARG 0 uuid
METHOD method_47804 (Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
ARG 0 string
METHOD method_54139 (Lcom/mojang/datafixers/util/Either;)Ljava/util/UUID;
ARG 0 either
METHOD method_54140 getOflinePlayerProfile (Ljava/lang/String;)Lcom/mojang/authlib/GameProfile;
ARG 0 nickname
METHOD method_54141 (Ljava/util/UUID;)Ljava/util/UUID;
ARG 0 uuid
METHOD method_54142 (Ljava/util/UUID;)Ljava/util/UUID;
ARG 0 uuid
28 changes: 28 additions & 0 deletions mappings/net/minecraft/util/dynamic/Codecs.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ CLASS net/minecraft/class_5699 net/minecraft/util/dynamic/Codecs
FIELD field_45075 IDENTIFIER_PATH Lcom/mojang/serialization/Codec;
FIELD field_45076 GAME_PROFILE Lcom/mojang/serialization/MapCodec;
FIELD field_46165 ESCAPED_STRING Lcom/mojang/serialization/Codec;
FIELD field_46236 BASIC_OBJECT Lcom/mojang/serialization/Codec;
COMMENT A passthrough codec for a basic object. See {@link RuntimeOps} for
COMMENT types of objects this can "serialize".
COMMENT
COMMENT @see RuntimeOps
METHOD method_33817 xor (Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
COMMENT Returns an exclusive-or codec for {@link Either} instances.
COMMENT
Expand Down Expand Up @@ -267,6 +272,8 @@ CLASS net/minecraft/class_5699 net/minecraft/util/dynamic/Codecs
ARG 0 keyCodec
METHOD method_53700 formattedTime (Ljava/time/format/DateTimeFormatter;)Lcom/mojang/serialization/Codec;
ARG 0 formatter
METHOD method_53701 (Ljava/time/format/DateTimeFormatter;Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
ARG 1 string
METHOD method_53702 either (Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)Lnet/minecraft/class_5699$class_6495;
ARG 0 first
ARG 1 second
Expand All @@ -275,6 +282,17 @@ CLASS net/minecraft/class_5699 net/minecraft/util/dynamic/Codecs
ARG 1 elementCodec
METHOD method_53826 (Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
ARG 0 string
METHOD method_53917 (Lcom/google/gson/JsonElement;)Lcom/mojang/serialization/DataResult;
ARG 0 json
METHOD method_53918 fromOps (Lcom/mojang/serialization/DynamicOps;)Lcom/mojang/serialization/Codec;
ARG 0 ops
METHOD method_53919 (Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/Dynamic;)Ljava/lang/Object;
ARG 1 dynamic
METHOD method_53920 (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/Dynamic;
ARG 1 object
METHOD method_53921 orCompressed (Lcom/mojang/serialization/MapCodec;Lcom/mojang/serialization/MapCodec;)Lcom/mojang/serialization/MapCodec;
ARG 0 uncompressedCodec
ARG 1 compressedCodec
CLASS 1
METHOD apply (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;Lcom/mojang/serialization/DataResult;)Lcom/mojang/serialization/DataResult;
ARG 1 ops
Expand All @@ -292,6 +310,16 @@ CLASS net/minecraft/class_5699 net/minecraft/util/dynamic/Codecs
ARG 1 input
ARG 2 ops
ARG 3 prefix
CLASS 3
METHOD decode (Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
ARG 1 ops
ARG 2 input
METHOD encode (Ljava/lang/Object;Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/RecordBuilder;)Lcom/mojang/serialization/RecordBuilder;
ARG 1 input
ARG 2 ops
ARG 3 prefix
METHOD keys (Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;
ARG 1 ops
CLASS 4
METHOD apply (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;Lcom/mojang/serialization/DataResult;)Lcom/mojang/serialization/DataResult;
ARG 1 ops
Expand Down
110 changes: 110 additions & 0 deletions mappings/net/minecraft/util/dynamic/RuntimeOps.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
CLASS net/minecraft/class_8806 net/minecraft/util/dynamic/RuntimeOps
COMMENT A dynamic ops that "serializes" data to a Java runtime representation.
COMMENT This is most useful when combined with another ops.
COMMENT
COMMENT <p>The objects must be one of: numbers, booleans, string, {@link Map}, {@link List},
COMMENT {@link it.unimi.dsi.fastutil.bytes.ByteList}, {@link
COMMENT it.unimi.dsi.fastutil.bytes.IntList}, or {@link it.unimi.dsi.fastutil.bytes.LongList}.
COMMENT Arrays are not supported.
COMMENT
COMMENT @see Codecs#BASIC_OBJECT
FIELD field_46239 INSTANCE Lnet/minecraft/class_8806;
METHOD convertTo (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Ljava/lang/Object;
ARG 1 ops
ARG 2 object
METHOD createBoolean (Z)Ljava/lang/Object;
ARG 1 value
METHOD createByte (B)Ljava/lang/Object;
ARG 1 value
METHOD createByteList (Ljava/nio/ByteBuffer;)Ljava/lang/Object;
ARG 1 buf
METHOD createDouble (D)Ljava/lang/Object;
ARG 1 value
METHOD createFloat (F)Ljava/lang/Object;
ARG 1 value
METHOD createInt (I)Ljava/lang/Object;
ARG 1 value
METHOD createIntList (Ljava/util/stream/IntStream;)Ljava/lang/Object;
ARG 1 stream
METHOD createList (Ljava/util/stream/Stream;)Ljava/lang/Object;
ARG 1 stream
METHOD createLong (J)Ljava/lang/Object;
ARG 1 value
METHOD createLongList (Ljava/util/stream/LongStream;)Ljava/lang/Object;
ARG 1 stream
METHOD createMap (Ljava/util/Map;)Ljava/lang/Object;
ARG 1 map
METHOD createMap (Ljava/util/stream/Stream;)Ljava/lang/Object;
ARG 1 entries
METHOD createNumeric (Ljava/lang/Number;)Ljava/lang/Object;
ARG 1 value
METHOD createShort (S)Ljava/lang/Object;
ARG 1 value
METHOD createString (Ljava/lang/String;)Ljava/lang/Object;
ARG 1 value
METHOD getBooleanValue (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 object
METHOD getByteBuffer (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 byteList
METHOD getIntStream (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 intList
METHOD getList (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 list
METHOD getLongStream (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 longList
METHOD getMap (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 map
METHOD getMapEntries (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 map
METHOD getMapValues (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 map
METHOD getNumberValue (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 object
METHOD getStream (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 list
METHOD getStringValue (Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 object
METHOD mergeToList (Ljava/lang/Object;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 list
ARG 2 value
METHOD mergeToList (Ljava/lang/Object;Ljava/util/List;)Lcom/mojang/serialization/DataResult;
ARG 1 list
ARG 2 values
METHOD mergeToMap (Ljava/lang/Object;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
ARG 1 map
ARG 2 map2
METHOD mergeToMap (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 map
ARG 2 key
ARG 3 value
METHOD mergeToMap (Ljava/lang/Object;Ljava/util/Map;)Lcom/mojang/serialization/DataResult;
ARG 1 map
ARG 2 map2
METHOD method_53922 (Lcom/google/common/collect/ImmutableMap$Builder;Lcom/mojang/datafixers/util/Pair;)V
ARG 1 pair
METHOD method_53923 toMap (Lcom/mojang/serialization/MapLike;)Ljava/util/Map;
ARG 0 mapLike
METHOD method_53925 (Ljava/util/Map$Entry;)Lcom/mojang/datafixers/util/Pair;
ARG 0 entry
METHOD method_53926 streamEntries (Ljava/util/Map;)Ljava/util/stream/Stream;
ARG 0 map
METHOD method_53932 (Ljava/lang/Object;)Ljava/lang/Object;
ARG 0 value
METHOD remove (Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
ARG 1 map
ARG 2 key
CLASS 1
METHOD get (Ljava/lang/Object;)Ljava/lang/Object;
ARG 1 key
METHOD get (Ljava/lang/String;)Ljava/lang/Object;
ARG 1 key
CLASS class_8807 MapBuilder
METHOD <init> (Lcom/mojang/serialization/DynamicOps;)V
ARG 1 ops
METHOD append (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
ARG 1 key
ARG 2 value
ARG 3 builder
METHOD build (Ljava/lang/Object;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
ARG 1 builder
ARG 2 map

0 comments on commit 9fc2409

Please sign in to comment.