Package dev.latvian.mods.kubejs.util
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SlotFilter> static final SlotFilterstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SlotFilter> static final dev.latvian.mods.rhino.type.TypeInfo -
Constructor Summary
ConstructorsConstructorDescriptionSlotFilter(net.minecraft.world.item.crafting.Ingredient item, int index) Creates an instance of aSlotFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckFilter(int index, net.minecraft.world.item.ItemStack stack) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.net.minecraft.world.item.crafting.Ingredientitem()Returns the value of theitemrecord component.static SlotFilterof(net.minecraft.world.item.crafting.Ingredient ingredient, int index) final StringtoString()Returns a string representation of this record class.static SlotFilter
-
Field Details
-
EMPTY
-
TYPE_INFO
public static final dev.latvian.mods.rhino.type.TypeInfo TYPE_INFO -
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 aSlotFilterrecord class.- Parameters:
item- the value for theitemrecord componentindex- the value for theindexrecord component
-
-
Method Details
-
of
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
item
public net.minecraft.world.item.crafting.Ingredient item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-