From 652752567341ef498757427bd21a3e1a04eee95a Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Sat, 7 Oct 2023 01:00:08 +0900 Subject: [PATCH] 23w40a util (#3684) * 23w40a util * Fix typo --- .../minecraft/util/StringIdentifiable.mapping | 32 ++++- mappings/net/minecraft/util/UserCache.mapping | 2 + mappings/net/minecraft/util/Util.mapping | 11 ++ mappings/net/minecraft/util/Uuids.mapping | 9 ++ .../net/minecraft/util/dynamic/Codecs.mapping | 28 +++++ .../minecraft/util/dynamic/RuntimeOps.mapping | 110 ++++++++++++++++++ 6 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 mappings/net/minecraft/util/dynamic/RuntimeOps.mapping diff --git a/mappings/net/minecraft/util/StringIdentifiable.mapping b/mappings/net/minecraft/util/StringIdentifiable.mapping index 213ffa02cc..ef73c33a35 100644 --- a/mappings/net/minecraft/util/StringIdentifiable.mapping +++ b/mappings/net/minecraft/util/StringIdentifiable.mapping @@ -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, @@ -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 @@ -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 ([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 diff --git a/mappings/net/minecraft/util/UserCache.mapping b/mappings/net/minecraft/util/UserCache.mapping index 9af7bcbc8b..e4cb88be7c 100644 --- a/mappings/net/minecraft/util/UserCache.mapping +++ b/mappings/net/minecraft/util/UserCache.mapping @@ -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 diff --git a/mappings/net/minecraft/util/Util.mapping b/mappings/net/minecraft/util/Util.mapping index f8e1a54759..706818fa54 100644 --- a/mappings/net/minecraft/util/Util.mapping +++ b/mappings/net/minecraft/util/Util.mapping @@ -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}} @@ -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 diff --git a/mappings/net/minecraft/util/Uuids.mapping b/mappings/net/minecraft/util/Uuids.mapping index 9785e24897..bed876664e 100644 --- a/mappings/net/minecraft/util/Uuids.mapping +++ b/mappings/net/minecraft/util/Uuids.mapping @@ -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 @@ -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 getOfflinePlayerProfile (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 diff --git a/mappings/net/minecraft/util/dynamic/Codecs.mapping b/mappings/net/minecraft/util/dynamic/Codecs.mapping index 34f30fa954..4eca25914f 100644 --- a/mappings/net/minecraft/util/dynamic/Codecs.mapping +++ b/mappings/net/minecraft/util/dynamic/Codecs.mapping @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/mappings/net/minecraft/util/dynamic/RuntimeOps.mapping b/mappings/net/minecraft/util/dynamic/RuntimeOps.mapping new file mode 100644 index 0000000000..c48b204ec3 --- /dev/null +++ b/mappings/net/minecraft/util/dynamic/RuntimeOps.mapping @@ -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

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 (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