Class BlockStateParser

java.lang.Object
net.minecraft.commands.arguments.blocks.BlockStateParser

public class BlockStateParser extends Object
  • Field Details

    • 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
    • SYNTAX_START_PROPERTIES

      private static final char SYNTAX_START_PROPERTIES
      See Also:
      Constant Field Values
    • SYNTAX_START_NBT

      private static final char SYNTAX_START_NBT
      See Also:
      Constant Field Values
    • SYNTAX_END_PROPERTIES

      private static final char SYNTAX_END_PROPERTIES
      See Also:
      Constant Field Values
    • SYNTAX_EQUALS

      private static final char SYNTAX_EQUALS
      See Also:
      Constant Field Values
    • SYNTAX_PROPERTY_SEPARATOR

      private static final char SYNTAX_PROPERTY_SEPARATOR
      See Also:
      Constant Field Values
    • SYNTAX_TAG

      private static final char SYNTAX_TAG
      See Also:
      Constant Field Values
    • SUGGEST_NOTHING

      private static final BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​TagCollection<Block>,​CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING
    • reader

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

      private final boolean forTesting
    • properties

      private final Map<Property<?>,​Comparable<?>> properties
    • vagueProperties

      private final Map<String,​String> vagueProperties
    • id

      private ResourceLocation id
    • definition

      private StateDefinition<Block,​BlockState> definition
    • state

      private BlockState state
    • nbt

      @Nullable private CompoundTag nbt
    • tag

      private ResourceLocation tag
    • tagCursor

      private int tagCursor
    • suggestions

      private BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​TagCollection<Block>,​CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
  • Constructor Details

    • BlockStateParser

      public BlockStateParser(com.mojang.brigadier.StringReader p_116762_, boolean p_116763_)
  • Method Details

    • getProperties

      public Map<Property<?>,​Comparable<?>> getProperties()
    • getState

      @Nullable public BlockState getState()
    • getNbt

      @Nullable public CompoundTag getNbt()
    • getTag

      @Nullable public ResourceLocation getTag()
    • parse

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

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestPropertyNameOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116810_, TagCollection<Block> p_116811_)
    • suggestVaguePropertyNameOrEnd

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyNameOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116817_, TagCollection<Block> p_116818_)
    • suggestPropertyName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestPropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116824_, TagCollection<Block> p_116825_)
    • suggestVaguePropertyName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116828_, TagCollection<Block> p_116829_)
    • suggestOpenNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116832_, TagCollection<Block> p_116833_)
    • hasBlockEntity

      private boolean hasBlockEntity(TagCollection<Block> p_116768_)
    • suggestEquals

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestEquals(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116836_, TagCollection<Block> p_116837_)
    • suggestNextPropertyOrEnd

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestNextPropertyOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116840_, TagCollection<Block> p_116841_)
    • addSuggestions

      private static <T extends Comparable<T>> com.mojang.brigadier.suggestion.SuggestionsBuilder addSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116787_, Property<T> p_116788_)
    • suggestVaguePropertyValue

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyValue(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116783_, TagCollection<Block> p_116784_, String p_116785_)
    • suggestOpenVaguePropertiesOrNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenVaguePropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116844_, TagCollection<Block> p_116845_)
    • suggestOpenPropertiesOrNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenPropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116848_, TagCollection<Block> p_116849_)
    • suggestTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116851_, TagCollection<Block> p_116852_)
    • suggestBlockIdOrTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockIdOrTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116854_, TagCollection<Block> p_116855_)
    • 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 Comparable<T>> void setValue(Property<T> p_116776_, String p_116777_, int p_116778_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • serialize

      public static String serialize(BlockState p_116770_)
    • appendProperty

      private static <T extends Comparable<T>> void appendProperty(StringBuilder p_116803_, Property<T> p_116804_, Comparable<?> p_116805_)
    • fillSuggestions

      public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_116780_, TagCollection<Block> p_116781_)
    • getVagueProperties

      public Map<String,​String> getVagueProperties()