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

      public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_TAG
    • 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 Function<com.mojang.brigadier.suggestion.SuggestionsBuilder,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING
    • blocks

      private final HolderLookup<Block> blocks
    • reader

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

      private final boolean forTesting
    • allowNbt

      private final boolean allowNbt
    • properties

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

      private final Map<String,String> vagueProperties
    • id

      private ResourceLocation id
    • definition

      @Nullable private StateDefinition<Block,BlockState> definition
    • state

      @Nullable private BlockState state
    • nbt

      @Nullable private CompoundTag nbt
    • tag

      @Nullable private HolderSet<Block> tag
    • suggestions

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

    • BlockStateParser

      private BlockStateParser(HolderLookup<Block> p_234673_, com.mojang.brigadier.StringReader p_234674_, boolean p_234675_, boolean p_234676_)
  • Method Details

    • parseForBlock

      public static BlockStateParser.BlockResult parseForBlock(HolderLookup<Block> p_251394_, String p_248677_, boolean p_250430_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseForBlock

      public static BlockStateParser.BlockResult parseForBlock(HolderLookup<Block> p_234692_, com.mojang.brigadier.StringReader p_234693_, boolean p_234694_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseForTesting

      public static com.mojang.datafixers.util.Either<BlockStateParser.BlockResult,BlockStateParser.TagResult> parseForTesting(HolderLookup<Block> p_252082_, String p_251830_, boolean p_249125_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseForTesting

      public static com.mojang.datafixers.util.Either<BlockStateParser.BlockResult,BlockStateParser.TagResult> parseForTesting(HolderLookup<Block> p_234717_, com.mojang.brigadier.StringReader p_234718_, boolean p_234719_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • fillSuggestions

      public static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions(HolderLookup<Block> p_234696_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_234697_, boolean p_234698_, boolean p_234699_)
    • parse

      private void parse() 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_234684_)
    • suggestVaguePropertyNameOrEnd

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyNameOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234715_)
    • suggestPropertyName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestPropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234729_)
    • suggestVaguePropertyName

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestVaguePropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234731_)
    • suggestOpenNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234733_)
    • hasBlockEntity

      private boolean hasBlockEntity()
    • suggestEquals

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestEquals(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234735_)
    • suggestNextPropertyOrEnd

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestNextPropertyOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234737_)
    • 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_234686_, String p_234687_)
    • suggestOpenVaguePropertiesOrNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenVaguePropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234739_)
    • suggestOpenPropertiesOrNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenPropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234741_)
    • suggestTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234743_)
    • suggestItem

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestItem(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234745_)
    • suggestBlockIdOrTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockIdOrTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_234747_)
    • readBlock

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

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

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

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

      private 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_)