Class BlockStateParser

java.lang.Object
net.minecraft.command.arguments.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
    • SUGGEST_NOTHING

      private static final BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,ITagCollection<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 StateContainer<Block,BlockState> definition
    • state

      private BlockState state
    • nbt

      @Nullable private CompoundNBT nbt
    • tag

      private ResourceLocation tag
    • tagCursor

      private int tagCursor
    • suggestions

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

    • BlockStateParser

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

    • getProperties

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

      @Nullable public BlockState getState()
    • getNbt

      @Nullable public CompoundNBT getNbt()
    • getTag

      @Nullable public ResourceLocation getTag()
    • parse

      public BlockStateParser parse(boolean p_197243_1_) 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_197252_1_, ITagCollection<Block> p_197252_2_)
    • suggestVaguePropertyNameOrEnd

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

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

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

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197244_1_, ITagCollection<Block> p_197244_2_)
    • hasBlockEntity

      private boolean hasBlockEntity(ITagCollection<Block> p_212598_1_)
    • suggestEquals

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

      private 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 Comparable<T>> com.mojang.brigadier.suggestion.SuggestionsBuilder addSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201037_0_, Property<T> p_201037_1_)
    • suggestVaguePropertyValue

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

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

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

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

      private 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 Comparable<T>> void setValue(Property<T> p_197253_1_, String p_197253_2_, int p_197253_3_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • serialize

      public static String serialize(BlockState p_197247_0_)
    • appendProperty

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

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

      public Map<String,String> getVagueProperties()