Package net.minecraft.command.arguments
Class BlockStateParser
- java.lang.Object
-
- net.minecraft.command.arguments.BlockStateParser
-
public class BlockStateParser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private StateContainer<Block,BlockState>
definition
static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
ERROR_DUPLICATE_PROPERTY
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_EXPECTED_END_OF_PROPERTIES
static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
ERROR_EXPECTED_VALUE
static com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType
ERROR_INVALID_VALUE
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_NO_TAGS_ALLOWED
static com.mojang.brigadier.exceptions.DynamicCommandExceptionType
ERROR_UNKNOWN_BLOCK
static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
ERROR_UNKNOWN_PROPERTY
private boolean
forTesting
private ResourceLocation
id
private CompoundNBT
nbt
private java.util.Map<Property<?>,java.lang.Comparable<?>>
properties
private com.mojang.brigadier.StringReader
reader
private BlockState
state
private static java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,ITagCollection<Block>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>>
SUGGEST_NOTHING
private java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,ITagCollection<Block>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>>
suggestions
private ResourceLocation
tag
private int
tagCursor
private java.util.Map<java.lang.String,java.lang.String>
vagueProperties
-
Constructor Summary
Constructors Constructor Description BlockStateParser(com.mojang.brigadier.StringReader p_i48214_1_, boolean p_i48214_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <T extends java.lang.Comparable<T>>
com.mojang.brigadier.suggestion.SuggestionsBuilderaddSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201037_0_, Property<T> p_201037_1_)
private static <T extends java.lang.Comparable<T>>
voidappendProperty(java.lang.StringBuilder p_211375_0_, Property<T> p_211375_1_, java.lang.Comparable<?> p_211375_2_)
java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
fillSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197245_1_, ITagCollection<Block> p_197245_2_)
CompoundNBT
getNbt()
java.util.Map<Property<?>,java.lang.Comparable<?>>
getProperties()
BlockState
getState()
ResourceLocation
getTag()
java.util.Map<java.lang.String,java.lang.String>
getVagueProperties()
private boolean
hasBlockEntity(ITagCollection<Block> p_212598_1_)
BlockStateParser
parse(boolean p_197243_1_)
void
readBlock()
void
readNbt()
void
readProperties()
void
readTag()
void
readVagueProperties()
static java.lang.String
serialize(BlockState p_197247_0_)
private <T extends java.lang.Comparable<T>>
voidsetValue(Property<T> p_197253_1_, java.lang.String p_197253_2_, int p_197253_3_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestBlockIdOrTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197250_1_, ITagCollection<Block> p_197250_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestEquals(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197246_1_, ITagCollection<Block> p_197246_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestNextPropertyOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197248_1_, ITagCollection<Block> p_197248_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOpenNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197244_1_, ITagCollection<Block> p_197244_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOpenPropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197255_1_, ITagCollection<Block> p_197255_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOpenVaguePropertiesOrNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_212599_1_, ITagCollection<Block> p_212599_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestPropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197256_1_, ITagCollection<Block> p_197256_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestPropertyNameOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197252_1_, ITagCollection<Block> p_197252_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201953_1_, ITagCollection<Block> p_201953_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestVaguePropertyName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_200134_1_, ITagCollection<Block> p_200134_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestVaguePropertyNameOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder p_200136_1_, ITagCollection<Block> p_200136_2_)
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_)
-
-
-
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
-
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 java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,ITagCollection<Block>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
-
-
Method Detail
-
getProperties
public java.util.Map<Property<?>,java.lang.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 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_)
-
hasBlockEntity
private boolean hasBlockEntity(ITagCollection<Block> p_212598_1_)
-
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()
-
-