Class ItemTagFilter

java.lang.Object
alexiil.mc.lib.attributes.item.filter.ItemTagFilter
All Implemented Interfaces:
ItemFilter, ReadableItemFilter, ResolvableItemFilter

public final class ItemTagFilter
extends java.lang.Object
implements ResolvableItemFilter
A ResolvableItemFilter that matches any Items in a Tag.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.filter.ItemFilter

    ItemFilter.ItemFilterAsPredicate
  • Field Summary

    Fields 
    Modifier and Type Field Description
    net.minecraft.tag.Tag<net.minecraft.item.Item> tag  
  • Constructor Summary

    Constructors 
    Constructor Description
    ItemTagFilter​(net.minecraft.tag.Tag<net.minecraft.item.Item> tag)  
  • Method Summary

    Modifier and Type Method Description
    ReadableItemFilter resolve()
    Resolves this ReadableItemFilter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface alexiil.mc.lib.attributes.item.filter.ItemFilter

    and, asPredicate, negate, or

    Methods inherited from interface alexiil.mc.lib.attributes.item.filter.ResolvableItemFilter

    matches
  • Field Details

    • tag

      public final net.minecraft.tag.Tag<net.minecraft.item.Item> tag
  • Constructor Details

    • ItemTagFilter

      public ItemTagFilter​(net.minecraft.tag.Tag<net.minecraft.item.Item> tag)
  • Method Details

    • resolve

      public ReadableItemFilter resolve()
      Description copied from interface: ResolvableItemFilter
      Resolves this ReadableItemFilter. Note that this must return one of the valid types of ReadableItemFilter, except this!

      This is intended for use-cases where you actually need to read the filter - for other cases there's usually little reason to call this, as "matches" should be faster for most reasonable implementations. (However some implementations - for example lambdas - might be faster to call multiple times if you resolve them before checking them).

      Specified by:
      resolve in interface ResolvableItemFilter