Class BlockStateParser


  • public class BlockStateParser
    extends java.lang.Object
    • Field Detail

      • ERROR_NO_TAGS_ALLOWED

        public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NO_TAGS_ALLOWED
      • ERROR_UNKNOWN_BLOCK

        public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_BLOCK
      • ERROR_UNKNOWN_PROPERTY

        public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_UNKNOWN_PROPERTY
      • ERROR_DUPLICATE_PROPERTY

        public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_DUPLICATE_PROPERTY
      • ERROR_INVALID_VALUE

        public static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType ERROR_INVALID_VALUE
      • ERROR_EXPECTED_VALUE

        public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_EXPECTED_VALUE
      • ERROR_EXPECTED_END_OF_PROPERTIES

        public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_EXPECTED_END_OF_PROPERTIES
      • SUGGEST_NOTHING

        private static final java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​ITagCollection<Block>,​java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING
      • reader

        private final com.mojang.brigadier.StringReader reader
      • forTesting

        private final boolean forTesting
      • properties

        private final java.util.Map<Property<?>,​java.lang.Comparable<?>> properties
      • vagueProperties

        private final java.util.Map<java.lang.String,​java.lang.String> vagueProperties
      • tagCursor

        private int tagCursor
      • suggestions

        private java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​ITagCollection<Block>,​java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
    • Constructor Detail

      • BlockStateParser

        public BlockStateParser​(com.mojang.brigadier.StringReader p_i48214_1_,
                                boolean p_i48214_2_)
    • Method Detail

      • getProperties

        public java.util.Map<Property<?>,​java.lang.Comparable<?>> getProperties()
      • getState

        @Nullable
        public BlockState getState()
      • parse

        public BlockStateParser parse​(boolean p_197243_1_)
                               throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • suggestPropertyNameOrEnd

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestPropertyNameOrEnd​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197252_1_,
                                                                                                                             ITagCollection<Block> p_197252_2_)
      • suggestVaguePropertyNameOrEnd

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyNameOrEnd​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_200136_1_,
                                                                                                                                  ITagCollection<Block> p_200136_2_)
      • suggestPropertyName

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestPropertyName​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197256_1_,
                                                                                                                        ITagCollection<Block> p_197256_2_)
      • suggestVaguePropertyName

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyName​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_200134_1_,
                                                                                                                             ITagCollection<Block> p_200134_2_)
      • suggestOpenNbt

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197244_1_,
                                                                                                                   ITagCollection<Block> p_197244_2_)
      • suggestEquals

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestEquals​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197246_1_,
                                                                                                                  ITagCollection<Block> p_197246_2_)
      • suggestNextPropertyOrEnd

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestNextPropertyOrEnd​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197248_1_,
                                                                                                                             ITagCollection<Block> p_197248_2_)
      • addSuggestions

        private static <T extends java.lang.Comparable<T>> com.mojang.brigadier.suggestion.SuggestionsBuilder addSuggestions​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201037_0_,
                                                                                                                             Property<T> p_201037_1_)
      • suggestVaguePropertyValue

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyValue​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_239295_1_,
                                                                                                                              ITagCollection<Block> p_239295_2_,
                                                                                                                              java.lang.String p_239295_3_)
      • suggestOpenVaguePropertiesOrNbt

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenVaguePropertiesOrNbt​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_212599_1_,
                                                                                                                                    ITagCollection<Block> p_212599_2_)
      • suggestOpenPropertiesOrNbt

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenPropertiesOrNbt​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197255_1_,
                                                                                                                               ITagCollection<Block> p_197255_2_)
      • suggestTag

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTag​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201953_1_,
                                                                                                               ITagCollection<Block> p_201953_2_)
      • suggestBlockIdOrTag

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockIdOrTag​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197250_1_,
                                                                                                                        ITagCollection<Block> p_197250_2_)
      • readBlock

        public void readBlock()
                       throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • readTag

        public void readTag()
                     throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • readProperties

        public void readProperties()
                            throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • readVagueProperties

        public void readVagueProperties()
                                 throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • readNbt

        public void readNbt()
                     throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • setValue

        private <T extends java.lang.Comparable<T>> void setValue​(Property<T> p_197253_1_,
                                                                  java.lang.String p_197253_2_,
                                                                  int p_197253_3_)
                                                           throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • serialize

        public static java.lang.String serialize​(BlockState p_197247_0_)
      • appendProperty

        private static <T extends java.lang.Comparable<T>> void appendProperty​(java.lang.StringBuilder p_211375_0_,
                                                                               Property<T> p_211375_1_,
                                                                               java.lang.Comparable<?> p_211375_2_)
      • fillSuggestions

        public java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197245_1_,
                                                                                                                   ITagCollection<Block> p_197245_2_)
      • getVagueProperties

        public java.util.Map<java.lang.String,​java.lang.String> getVagueProperties()