Skip to content

Commit

Permalink
25w10a packrat parser (#4145)
Browse files Browse the repository at this point in the history
* Map packrat parsing

* Repackage packrat

* Map NBT
  • Loading branch information
apple502j authored Mar 7, 2025
1 parent f3a165b commit 3b42573
Show file tree
Hide file tree
Showing 59 changed files with 523 additions and 82 deletions.
3 changes: 0 additions & 3 deletions mappings/net/minecraft/class_10846.mapping

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CLASS net/minecraft/class_2293 net/minecraft/command/argument/ItemPredicateArgum
CLASS class_9444 ComponentCheck
METHOD method_58535 createPredicate (Lcom/mojang/brigadier/ImmutableStringReader;Lcom/mojang/serialization/Dynamic;)Ljava/util/function/Predicate;
ARG 1 reader
ARG 2 value
METHOD method_58536 read (Lcom/mojang/brigadier/ImmutableStringReader;Lnet/minecraft/class_2960;Lnet/minecraft/class_9331;)Lnet/minecraft/class_2293$class_9444;
ARG 0 reader
ARG 1 id
Expand Down Expand Up @@ -82,5 +83,6 @@ CLASS net/minecraft/class_2293 net/minecraft/command/argument/ItemPredicateArgum
ARG 0 predicate
METHOD method_58559 createPredicate (Lcom/mojang/brigadier/ImmutableStringReader;Lcom/mojang/serialization/Dynamic;)Ljava/util/function/Predicate;
ARG 1 reader
ARG 2 value
METHOD method_58560 (Lcom/mojang/brigadier/ImmutableStringReader;Ljava/lang/String;)Lcom/mojang/brigadier/exceptions/CommandSyntaxException;
ARG 2 error
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CLASS net/minecraft/class_9437 net/minecraft/command/argument/packrat/PackratParsing
CLASS net/minecraft/class_9437 net/minecraft/command/argument/ItemPredicateParsing
METHOD method_58492 (Lnet/minecraft/class_9387;Lnet/minecraft/class_9387;Lnet/minecraft/class_9400;)Ljava/lang/Object;
ARG 2 results
METHOD method_58493 (Lnet/minecraft/class_9387;Lnet/minecraft/class_9387;Lnet/minecraft/class_9437$class_9439;Lnet/minecraft/class_9387;Lnet/minecraft/class_9393;)Ljava/lang/Object;
Expand All @@ -23,6 +23,7 @@ CLASS net/minecraft/class_9437 net/minecraft/command/argument/packrat/PackratPar
ARG 2 results
CLASS class_9438 ComponentParsingRule
METHOD <init> (Lnet/minecraft/class_10842;Lnet/minecraft/class_9437$class_9439;)V
ARG 1 idParsingRule
ARG 2 callbacks
CLASS class_9439 Callbacks
METHOD method_58503 streamItemIds ()Ljava/util/stream/Stream;
Expand Down Expand Up @@ -58,10 +59,13 @@ CLASS net/minecraft/class_9437 net/minecraft/command/argument/packrat/PackratPar
ARG 2 id
CLASS class_9440 ItemParsingRule
METHOD <init> (Lnet/minecraft/class_10842;Lnet/minecraft/class_9437$class_9439;)V
ARG 1 idParsingRule
ARG 2 callbacks
CLASS class_9441 SubPredicateParsingRule
METHOD <init> (Lnet/minecraft/class_10842;Lnet/minecraft/class_9437$class_9439;)V
ARG 1 idParsingRule
ARG 2 callbacks
CLASS class_9442 TagParsingRule
METHOD <init> (Lnet/minecraft/class_10842;Lnet/minecraft/class_9437$class_9439;)V
ARG 1 idParsingRule
ARG 2 callbacks
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CLASS net/minecraft/class_2212 net/minecraft/command/argument/NbtElementArgumentType
FIELD field_57831 PARSER Lnet/minecraft/class_10846;
FIELD field_9918 EXAMPLES Ljava/util/Collection;
METHOD method_9389 nbtElement ()Lnet/minecraft/class_2212;
METHOD method_9390 getNbtElement (Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;)Lnet/minecraft/class_2520;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CLASS net/minecraft/class_10850 net/minecraft/command/argument/ParserBackedArgumentType
FIELD field_57549 parser Lnet/minecraft/class_10846;
METHOD <init> (Lnet/minecraft/class_10846;)V
ARG 1 parser
METHOD listSuggestions (Lcom/mojang/brigadier/context/CommandContext;Lcom/mojang/brigadier/suggestion/SuggestionsBuilder;)Ljava/util/concurrent/CompletableFuture;
ARG 1 context
ARG 2 builder
METHOD parse (Lcom/mojang/brigadier/StringReader;)Ljava/lang/Object;
ARG 1 reader
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CLASS net/minecraft/class_2223 net/minecraft/command/argument/ParticleEffectArgumentType
FIELD field_48929 registries Lnet/minecraft/class_7225$class_7874;
FIELD field_51438 INVALID_OPTIONS_EXCEPTION Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;
FIELD field_57832 snbtReader Lnet/minecraft/class_2522;
FIELD field_57832 SNBT_READER Lnet/minecraft/class_2522;
FIELD field_9935 EXAMPLES Ljava/util/Collection;
FIELD field_9936 UNKNOWN_PARTICLE_EXCEPTION Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;
METHOD <init> (Lnet/minecraft/class_7157;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CLASS net/minecraft/class_9433 net/minecraft/command/argument/RegistryEntryArgum
FIELD field_50040 registries Lnet/minecraft/class_7225$class_7874;
FIELD field_50041 canLookupRegistry Z
FIELD field_50042 entryCodec Lcom/mojang/serialization/Codec;
FIELD field_57909 snbtReader Lnet/minecraft/class_2522;
FIELD field_57909 SNBT_READER Lnet/minecraft/class_2522;
METHOD <init> (Lnet/minecraft/class_7157;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)V
ARG 1 registryAccess
ARG 2 registry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CLASS net/minecraft/class_9019 net/minecraft/command/argument/StyleArgumentType
FIELD field_47554 EXAMPLES Ljava/util/Collection;
FIELD field_55866 INVALID_STYLE_EXCEPTION Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;
FIELD field_57922 PARSER Lnet/minecraft/class_10846;
METHOD <init> (Lnet/minecraft/class_7225$class_7874;)V
ARG 1 registries
METHOD method_55446 style (Lnet/minecraft/class_7157;)Lnet/minecraft/class_9019;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CLASS net/minecraft/class_2178 net/minecraft/command/argument/TextArgumentType
FIELD field_57829 PARSER Lnet/minecraft/class_10846;
FIELD field_9841 EXAMPLES Ljava/util/Collection;
FIELD field_9842 INVALID_COMPONENT_EXCEPTION Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;
METHOD <init> (Lnet/minecraft/class_7225$class_7874;)V
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions mappings/net/minecraft/command/argument/packrat/Cut.mapping

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions mappings/net/minecraft/command/argument/packrat/Term.mapping

This file was deleted.

2 changes: 0 additions & 2 deletions mappings/net/minecraft/nbt/NbtByte.mapping
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
CLASS net/minecraft/class_2481 net/minecraft/nbt/NbtByte
COMMENT Represents an NBT byte. Its type is {@value NbtElement#BYTE_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3817 value B
FIELD field_21025 TYPE Lnet/minecraft/class_4614;
FIELD field_21026 ZERO Lnet/minecraft/class_2481;
COMMENT The NBT byte representing {@code 0}.
Expand All @@ -14,7 +13,6 @@ CLASS net/minecraft/class_2481 net/minecraft/nbt/NbtByte
FIELD field_41717 SIZE I
METHOD <init> (B)V
ARG 1 value
METHOD comp_3817 value ()B
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_23233 of (B)Lnet/minecraft/class_2481;
Expand Down
7 changes: 7 additions & 0 deletions mappings/net/minecraft/nbt/NbtCompound.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ CLASS net/minecraft/class_2487 net/minecraft/nbt/NbtCompound
ARG 1 key
ARG 2 codec
ARG 3 value
METHOD method_67495 (Ljava/lang/String;Lnet/minecraft/class_2520;Ljava/lang/String;)V
ARG 2 error
METHOD method_67496 (Ljava/lang/String;)V
ARG 1 error
METHOD method_68080 getLong (Ljava/lang/String;J)J
COMMENT {@return the {@code long} associated with {@code key}, or {@code fallback} if there is
COMMENT no number stored with the key}
Expand Down Expand Up @@ -370,6 +374,9 @@ CLASS net/minecraft/class_2487 net/minecraft/nbt/NbtCompound
ARG 1 key
METHOD method_68570 getOptional (Ljava/lang/String;)Ljava/util/Optional;
ARG 1 key
METHOD method_68721 (Ljava/util/HashMap;Ljava/lang/String;Lnet/minecraft/class_2520;)V
ARG 1 key
ARG 2 value
CLASS 1
METHOD method_53888 scanCompound (Ljava/io/DataInput;Lnet/minecraft/class_6836;Lnet/minecraft/class_2505;)Lnet/minecraft/class_6836$class_6838;
ARG 0 input
Expand Down
2 changes: 0 additions & 2 deletions mappings/net/minecraft/nbt/NbtDouble.mapping
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
CLASS net/minecraft/class_2489 net/minecraft/nbt/NbtDouble
COMMENT Represents an NBT 64-bit floating-point number. Its type is {@value NbtElement#DOUBLE_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3818 value D
FIELD field_21030 ZERO Lnet/minecraft/class_2489;
COMMENT The NBT double representing {@code 0.0}.
FIELD field_21031 TYPE Lnet/minecraft/class_4614;
FIELD field_41720 SIZE I
METHOD <init> (D)V
ARG 1 value
METHOD comp_3818 value ()D
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_23241 of (D)Lnet/minecraft/class_2489;
Expand Down
2 changes: 0 additions & 2 deletions mappings/net/minecraft/nbt/NbtFloat.mapping
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
CLASS net/minecraft/class_2494 net/minecraft/nbt/NbtFloat
COMMENT Represents an NBT 32-bit floating-point number. Its type is {@value NbtElement#FLOAT_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3819 value F
FIELD field_21034 ZERO Lnet/minecraft/class_2494;
COMMENT The NBT float representing {@code 0.0f}.
FIELD field_21035 TYPE Lnet/minecraft/class_4614;
FIELD field_41722 SIZE I
METHOD <init> (F)V
ARG 1 value
METHOD comp_3819 value ()F
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_23244 of (F)Lnet/minecraft/class_2494;
Expand Down
12 changes: 12 additions & 0 deletions mappings/net/minecraft/nbt/NbtHelper.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CLASS net/minecraft/class_2512 net/minecraft/nbt/NbtHelper
FIELD field_33226 RIGHT_CURLY_BRACKET C
FIELD field_33227 COMMA Ljava/lang/String;
FIELD field_33228 COLON C
FIELD field_57978 BLOCK_KEY_CODEC Lcom/mojang/serialization/Codec;
METHOD method_10681 toBlockState (Lnet/minecraft/class_7871;Lnet/minecraft/class_2487;)Lnet/minecraft/class_2680;
COMMENT {@return the block state from the {@code nbt}}
COMMENT
Expand Down Expand Up @@ -72,6 +73,8 @@ CLASS net/minecraft/class_2512 net/minecraft/nbt/NbtHelper
ARG 0 string
METHOD method_32261 (Ljava/util/Map;Lnet/minecraft/class_2487;)Lnet/minecraft/class_2499;
ARG 1 nbt
METHOD method_32262 (Ljava/lang/StringBuilder;Lnet/minecraft/class_2487;)V
ARG 1 properties
METHOD method_32263 (Lnet/minecraft/class_2487;Ljava/lang/String;Ljava/lang/String;)V
ARG 2 property
METHOD method_32264 (Lnet/minecraft/class_2499;)D
Expand Down Expand Up @@ -128,6 +131,7 @@ CLASS net/minecraft/class_2512 net/minecraft/nbt/NbtHelper
ARG 0 state
METHOD method_36116 appendFormattedString (Ljava/lang/StringBuilder;Lnet/minecraft/class_2520;IZ)Ljava/lang/StringBuilder;
ARG 0 stringBuilder
ARG 1 nbt
ARG 2 depth
ARG 3 withArrayContents
METHOD method_36117 toFormattedString (Lnet/minecraft/class_2520;Z)Ljava/lang/String;
Expand Down Expand Up @@ -157,3 +161,11 @@ CLASS net/minecraft/class_2512 net/minecraft/nbt/NbtHelper
METHOD method_68084 getDataVersion (Lcom/mojang/serialization/Dynamic;I)I
ARG 0 dynamic
ARG 1 fallback
METHOD method_68595 (Ljava/util/Map$Entry;)Ljava/lang/String;
ARG 0 entry
METHOD method_68596 (Lnet/minecraft/class_2487;Ljava/lang/String;)Ljava/lang/String;
ARG 1 key
METHOD method_68597 (Lnet/minecraft/class_2520;)Ljava/util/stream/Stream;
ARG 0 nbt
METHOD method_68598 (Lnet/minecraft/class_2520;)Ljava/util/stream/Stream;
ARG 0 nbt
2 changes: 0 additions & 2 deletions mappings/net/minecraft/nbt/NbtInt.mapping
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
CLASS net/minecraft/class_2497 net/minecraft/nbt/NbtInt
COMMENT Represents an NBT 32-bit integer. Its type is {@value NbtElement#INT_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3820 value I
FIELD field_21037 TYPE Lnet/minecraft/class_4614;
FIELD field_41724 SIZE I
METHOD <init> (I)V
ARG 1 value
METHOD comp_3820 value ()I
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_23247 of (I)Lnet/minecraft/class_2497;
Expand Down
7 changes: 5 additions & 2 deletions mappings/net/minecraft/nbt/NbtList.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CLASS net/minecraft/class_2499 net/minecraft/nbt/NbtList
FIELD field_11550 value Ljava/util/List;
FIELD field_21039 TYPE Lnet/minecraft/class_4614;
FIELD field_41725 SIZE I
FIELD field_57977 HOMOGENIZED_ENTRY_KEY Ljava/lang/String;
METHOD <init> (Ljava/util/List;)V
ARG 1 value
METHOD add (ILjava/lang/Object;)V
Expand Down Expand Up @@ -88,17 +89,19 @@ CLASS net/minecraft/class_2499 net/minecraft/nbt/NbtList
ARG 2 fallback
METHOD method_68579 unwrap (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2520;
ARG 0 nbt
METHOD method_68580 unwrapAndAdd (Lnet/minecraft/class_2520;)V
ARG 1 nbt
METHOD method_68581 (Lnet/minecraft/class_2520;Ljava/util/function/Consumer;)V
ARG 0 nbt
ARG 1 callback
METHOD method_68582 getOrCreateCompound (I)Lnet/minecraft/class_2487;
METHOD method_68582 getCompoundOrEmpty (I)Lnet/minecraft/class_2487;
ARG 1 index
METHOD method_68583 isConvertedEntry (Lnet/minecraft/class_2487;)Z
ARG 0 nbt
METHOD method_68584 convertToCompound (Lnet/minecraft/class_2520;)Lnet/minecraft/class_2487;
ARG 0 nbt
METHOD method_68587 getValueType ()B
METHOD method_68588 getOrCreateList (I)Lnet/minecraft/class_2499;
METHOD method_68588 getListOrEmpty (I)Lnet/minecraft/class_2499;
ARG 1 index
METHOD method_68589 streamCompounds ()Ljava/util/stream/Stream;
METHOD method_68590 getNullable (I)Lnet/minecraft/class_2520;
Expand Down
2 changes: 0 additions & 2 deletions mappings/net/minecraft/nbt/NbtLong.mapping
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
CLASS net/minecraft/class_2503 net/minecraft/nbt/NbtLong
COMMENT Represents an NBT 64-bit integer. Its type is {@value NbtElement#LONG_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3821 value J
FIELD field_21041 TYPE Lnet/minecraft/class_4614;
FIELD field_41727 SIZE I
METHOD <init> (J)V
ARG 1 value
METHOD comp_3821 value ()J
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_23251 of (J)Lnet/minecraft/class_2503;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CLASS net/minecraft/class_9416 net/minecraft/command/argument/packrat/NbtParsingRule
CLASS net/minecraft/class_9416 net/minecraft/nbt/NbtParsingRule
FIELD field_56253 ops Lcom/mojang/serialization/DynamicOps;
FIELD field_57559 nbtReader Lnet/minecraft/class_2522;
METHOD <init> (Lcom/mojang/serialization/DynamicOps;)V
ARG 1 ops
2 changes: 0 additions & 2 deletions mappings/net/minecraft/nbt/NbtShort.mapping
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
CLASS net/minecraft/class_2516 net/minecraft/nbt/NbtShort
COMMENT Represents an NBT 16-bit integer. Its type is {@value NbtElement#SHORT_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3822 value S
FIELD field_21043 TYPE Lnet/minecraft/class_4614;
FIELD field_41728 SIZE I
METHOD <init> (S)V
ARG 1 value
METHOD comp_3822 value ()S
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_23254 of (S)Lnet/minecraft/class_2516;
Expand Down
5 changes: 3 additions & 2 deletions mappings/net/minecraft/nbt/NbtString.mapping
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
CLASS net/minecraft/class_2519 net/minecraft/nbt/NbtString
COMMENT Represents an NBT string. Its type is {@value NbtElement#STRING_TYPE}.
COMMENT Instances are immutable.
FIELD comp_3831 value Ljava/lang/String;
FIELD field_21045 TYPE Lnet/minecraft/class_4614;
FIELD field_21046 EMPTY Lnet/minecraft/class_2519;
FIELD field_33242 DOUBLE_QUOTE C
Expand All @@ -11,7 +10,6 @@ CLASS net/minecraft/class_2519 net/minecraft/nbt/NbtString
FIELD field_41729 SIZE I
METHOD <init> (Ljava/lang/String;)V
ARG 1 value
METHOD comp_3831 value ()Ljava/lang/String;
METHOD equals (Ljava/lang/Object;)Z
ARG 1 o
METHOD method_10706 escape (Ljava/lang/String;)Ljava/lang/String;
Expand All @@ -29,6 +27,9 @@ CLASS net/minecraft/class_2519 net/minecraft/nbt/NbtString
ARG 0 value
METHOD method_39875 skip (Ljava/io/DataInput;)V
ARG 0 input
METHOD method_68657 appendEscaped (Ljava/lang/String;Ljava/lang/StringBuilder;)V
ARG 0 value
ARG 1 builder
CLASS 1
METHOD method_53904 readString (Ljava/io/DataInput;Lnet/minecraft/class_2505;)Ljava/lang/String;
ARG 0 input
Expand Down
19 changes: 19 additions & 0 deletions mappings/net/minecraft/nbt/SnbtOperation.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CLASS net/minecraft/class_10916 net/minecraft/nbt/SnbtOperation
FIELD field_58061 TRUE Ljava/lang/String;
FIELD field_58062 FALSE Ljava/lang/String;
FIELD field_58063 OPERATIONS Ljava/util/Map;
FIELD field_58064 SUGGESTIONS Lnet/minecraft/class_9401;
FIELD field_58065 EXPECTED_STRING_UUID_EXCEPTION Lnet/minecraft/class_10837;
FIELD field_58066 EXPECTED_NUMBER_OR_BOOLEAN_EXCEPTION Lnet/minecraft/class_10837;
CLASS 1
METHOD method_68728 asBoolean (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Ljava/lang/Boolean;
ARG 0 ops
ARG 1 value
CLASS 3
FIELD field_58067 values Ljava/util/Set;
CLASS class_10917 Type
CLASS class_10918 Operator
METHOD method_68729 apply (Lcom/mojang/serialization/DynamicOps;Ljava/util/List;Lnet/minecraft/class_9393;)Ljava/lang/Object;
ARG 1 ops
ARG 2 args
ARG 3 state
Loading

0 comments on commit 3b42573

Please sign in to comment.