Class ItemParser


  • public class ItemParser
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NO_TAGS_ALLOWED  
      static com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_ITEM  
      private boolean forTesting  
      private Item item  
      private CompoundNBT nbt  
      private java.util.Map<Property<?>,​java.lang.Comparable<?>> properties  
      private com.mojang.brigadier.StringReader reader  
      private static java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​ITagCollection<Item>,​java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING  
      private java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​ITagCollection<Item>,​java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions  
      private ResourceLocation tag  
      private int tagCursor  
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemParser​(com.mojang.brigadier.StringReader p_i48213_1_, boolean p_i48213_2_)  
    • Field Detail

      • ERROR_NO_TAGS_ALLOWED

        public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NO_TAGS_ALLOWED
      • ERROR_UNKNOWN_ITEM

        public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_ITEM
      • SUGGEST_NOTHING

        private static final java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​ITagCollection<Item>,​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
      • item

        private Item item
      • tagCursor

        private int tagCursor
      • suggestions

        private java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,​ITagCollection<Item>,​java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
    • Constructor Detail

      • ItemParser

        public ItemParser​(com.mojang.brigadier.StringReader p_i48213_1_,
                          boolean p_i48213_2_)
    • Method Detail

      • getItem

        public Item getItem()
      • readItem

        public void readItem()
                      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
      • readNbt

        public void readNbt()
                     throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • parse

        public ItemParser parse()
                         throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • suggestOpenNbt

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197328_1_,
                                                                                                                   ITagCollection<Item> p_197328_2_)
      • suggestTag

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTag​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201955_1_,
                                                                                                               ITagCollection<Item> p_201955_2_)
      • suggestItemIdOrTag

        private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestItemIdOrTag​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197331_1_,
                                                                                                                       ITagCollection<Item> p_197331_2_)
      • fillSuggestions

        public java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions​(com.mojang.brigadier.suggestion.SuggestionsBuilder p_197329_1_,
                                                                                                                   ITagCollection<Item> p_197329_2_)