Record Class SlotFilter

java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.util.SlotFilter

public record SlotFilter(net.minecraft.world.item.crafting.Ingredient item, int index) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<SlotFilter>
     
    static final SlotFilter
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SlotFilter>
     
    static final dev.latvian.mods.rhino.type.TypeInfo
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SlotFilter(net.minecraft.world.item.crafting.Ingredient item, int index)
    Creates an instance of a SlotFilter record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkFilter(int index, net.minecraft.world.item.ItemStack stack)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the index record component.
    net.minecraft.world.item.crafting.Ingredient
    Returns the value of the item record component.
    static SlotFilter
    of(net.minecraft.world.item.crafting.Ingredient ingredient, int index)
     
    final String
    Returns a string representation of this record class.
    static SlotFilter
    wrap(dev.latvian.mods.rhino.Context cx, Object o, dev.latvian.mods.rhino.type.TypeInfo target)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • EMPTY

      public static final SlotFilter EMPTY
    • TYPE_INFO

      public static final dev.latvian.mods.rhino.type.TypeInfo TYPE_INFO
    • CODEC

      public static final com.mojang.serialization.Codec<SlotFilter> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SlotFilter> STREAM_CODEC
  • Constructor Details

    • SlotFilter

      public SlotFilter(net.minecraft.world.item.crafting.Ingredient item, int index)
      Creates an instance of a SlotFilter record class.
      Parameters:
      item - the value for the item record component
      index - the value for the index record component
  • Method Details

    • of

      public static SlotFilter of(net.minecraft.world.item.crafting.Ingredient ingredient, int index)
    • wrap

      public static SlotFilter wrap(dev.latvian.mods.rhino.Context cx, Object o, dev.latvian.mods.rhino.type.TypeInfo target)
    • checkFilter

      public boolean checkFilter(int index, net.minecraft.world.item.ItemStack stack)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • item

      public net.minecraft.world.item.crafting.Ingredient item()
      Returns the value of the item record component.
      Returns:
      the value of the item record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component