public class BlockArgumentParser extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
allowTag |
private Identifier |
blockId |
private Map<Property<?>,Comparable<?>> |
blockProperties |
private BlockState |
blockState |
private int |
cursorPos |
private CompoundTag |
data |
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType |
DISALLOWED_TAG_EXCEPTION |
static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType |
DUPLICATE_PROPERTY_EXCEPTION |
static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType |
EMPTY_PROPERTY_EXCEPTION |
static com.mojang.brigadier.exceptions.DynamicCommandExceptionType |
INVALID_BLOCK_ID_EXCEPTION |
static com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType |
INVALID_PROPERTY_EXCEPTION |
private com.mojang.brigadier.StringReader |
reader |
private StateManager<Block,BlockState> |
stateFactory |
private static BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,TagGroup<Block>,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> |
SUGGEST_DEFAULT |
private BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,TagGroup<Block>,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> |
suggestions |
private Identifier |
tagId |
private Map<String,String> |
tagProperties |
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType |
UNCLOSED_PROPERTIES_EXCEPTION |
static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType |
UNKNOWN_PROPERTY_EXCEPTION |
Constructor and Description |
---|
BlockArgumentParser(com.mojang.brigadier.StringReader reader,
boolean allowTag) |
Modifier and Type | Method and Description |
---|---|
Map<Property<?>,Comparable<?>> |
getBlockProperties() |
BlockState |
getBlockState() |
CompoundTag |
getNbtData() |
Map<String,String> |
getProperties() |
CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
getSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
Identifier |
getTagId() |
private boolean |
hasBlockEntity(TagGroup<Block> tagGroup) |
BlockArgumentParser |
parse(boolean allowNbt) |
void |
parseBlockId() |
void |
parseBlockProperties() |
private <T extends Comparable<T>> |
parsePropertyValue(Property<T> property,
String string,
int int2) |
void |
parseSnbt() |
void |
parseTagId() |
void |
parseTagProperties() |
static String |
stringifyBlockState(BlockState blockState) |
private static <T extends Comparable<T>> |
stringifyProperty(StringBuilder stringBuilder,
Property<T> property,
Comparable<?> comparable) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestBlockOrTagId(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestBlockProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestBlockPropertiesOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestCommaOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestEqualsCharacter(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestIdentifiers(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private static <T extends Comparable<T>> |
suggestPropertyValues(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
Property<T> property) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestSnbt(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestSnbtOrBlockProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestSnbtOrTagProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestTagProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestTagPropertiesOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup) |
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
suggestTagPropertyValues(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder,
TagGroup<Block> tagGroup,
String string) |
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType DISALLOWED_TAG_EXCEPTION
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType INVALID_BLOCK_ID_EXCEPTION
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType UNKNOWN_PROPERTY_EXCEPTION
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType DUPLICATE_PROPERTY_EXCEPTION
public static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType INVALID_PROPERTY_EXCEPTION
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType EMPTY_PROPERTY_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType UNCLOSED_PROPERTIES_EXCEPTION
private static final BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,TagGroup<Block>,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_DEFAULT
private final com.mojang.brigadier.StringReader reader
private final boolean allowTag
private final Map<Property<?>,Comparable<?>> blockProperties
private Identifier blockId
private StateManager<Block,BlockState> stateFactory
private BlockState blockState
@Nullable private CompoundTag data
private Identifier tagId
private int cursorPos
private BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,TagGroup<Block>,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
public BlockArgumentParser(com.mojang.brigadier.StringReader reader, boolean allowTag)
public Map<Property<?>,Comparable<?>> getBlockProperties()
@Nullable public BlockState getBlockState()
@Nullable public CompoundTag getNbtData()
@Nullable public Identifier getTagId()
public BlockArgumentParser parse(boolean allowNbt) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockPropertiesOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTagPropertiesOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTagProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestSnbt(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestEqualsCharacter(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestCommaOrEnd(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private static <T extends Comparable<T>> com.mojang.brigadier.suggestion.SuggestionsBuilder suggestPropertyValues(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, Property<T> property)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTagPropertyValues(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup, String string)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestSnbtOrTagProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestSnbtOrBlockProperties(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestIdentifiers(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestBlockOrTagId(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)
public void parseBlockId() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public void parseTagId() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public void parseBlockProperties() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public void parseTagProperties() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public void parseSnbt() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
private <T extends Comparable<T>> void parsePropertyValue(Property<T> property, String string, int int2)
public static String stringifyBlockState(BlockState blockState)
private static <T extends Comparable<T>> void stringifyProperty(StringBuilder stringBuilder, Property<T> property, Comparable<?> comparable)
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> getSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder, TagGroup<Block> tagGroup)