Class RawFluidTagFilter

java.lang.Object
alexiil.mc.lib.attributes.fluid.filter.RawFluidTagFilter
All Implemented Interfaces:
FluidFilter, ReadableFluidFilter, ResolvableFluidFilter

public final class RawFluidTagFilter extends Object implements ResolvableFluidFilter
A FluidFilter that operates on a Tag of vanilla minecraft's Fluid's.
  • Field Details

    • tag

      @Deprecated public final net.minecraft.tag.Tag<net.minecraft.fluid.Fluid> tag
      Deprecated.
  • Constructor Details

    • RawFluidTagFilter

      @Deprecated public RawFluidTagFilter(net.minecraft.tag.Tag<net.minecraft.fluid.Fluid> tag)
      Deprecated.
      1.18.1 constructor. Don't use this for 1.18.2 or later.
    • RawFluidTagFilter

      public RawFluidTagFilter(net.minecraft.tag.TagKey<net.minecraft.fluid.Fluid> tagKey)
      1.18.2 constructor. Don't use this for 1.18.1 or earlier.
  • Method Details

    • matches

      public boolean matches(FluidKey fluidKey)
      Description copied from interface: ResolvableFluidFilter
      Checks to see if the given filter matches the given fluid key.

      This is overridden primarily for lambdas - most implementing classes are expected to override this, because it will most likely be faster.

      Specified by:
      matches in interface FluidFilter
      Specified by:
      matches in interface ResolvableFluidFilter
    • resolve

      public ReadableFluidFilter resolve()
      Description copied from interface: ResolvableFluidFilter
      Resolves this ReadableFluidFilter. Note that this must return one of the valid types of ReadableFluidFilter, 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 ResolvableFluidFilter