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:
    • SYNTAX_START_NBT

      private static final char SYNTAX_START_NBT
      See Also:
    • SYNTAX_END_PROPERTIES

      private static final char SYNTAX_END_PROPERTIES
      See Also:
    • SYNTAX_EQUALS

      private static final char SYNTAX_EQUALS
      See Also:
    • SYNTAX_PROPERTY_SEPARATOR

      private static final char SYNTAX_PROPERTY_SEPARATOR
      See Also:
    • SYNTAX_TAG

      private static final char SYNTAX_TAG
      See Also:
    • SUGGEST_NOTHING

      private static final BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,Registry<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

      @Nullable private TagKey<Block> tag
    • tagCursor

      private int tagCursor
    • suggestions

      private BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,Registry<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 TagKey<Block> 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_205612_, Registry<Block> p_205613_)
    • suggestVaguePropertyNameOrEnd

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyNameOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205615_, Registry<Block> p_205616_)
    • suggestPropertyName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestPropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205619_, Registry<Block> p_205620_)
    • suggestVaguePropertyName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205622_, Registry<Block> p_205623_)
    • suggestOpenNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205625_, Registry<Block> p_205626_)
    • hasBlockEntity

      private boolean hasBlockEntity(Registry<Block> p_205606_)
    • suggestEquals

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestEquals(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205628_, Registry<Block> p_205629_)
    • suggestNextPropertyOrEnd

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestNextPropertyOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205631_, Registry<Block> p_205632_)
    • 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_205598_, Registry<Block> p_205599_, String p_205600_)
    • suggestOpenVaguePropertiesOrNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenVaguePropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205634_, Registry<Block> p_205635_)
    • suggestOpenPropertiesOrNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenPropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205637_, Registry<Block> p_205638_)
    • suggestTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205640_, Registry<Block> p_205641_)
    • suggestBlockIdOrTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockIdOrTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_205643_, Registry<Block> p_205644_)
    • 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_205595_, Registry<Block> p_205596_)
    • getVagueProperties

      public Map<String,String> getVagueProperties()