Record Class SlotCollection.FlatMapped
java.lang.Object
java.lang.Record
net.minecraft.world.item.slot.SlotCollection.FlatMapped
- All Implemented Interfaces:
SlotCollection
- Enclosing interface:
SlotCollection
public static record SlotCollection.FlatMapped(SlotCollection slots, Function<ItemStack, ? extends SlotCollection> mapper)
extends Record
implements SlotCollection
-
Nested Class Summary
Nested classes/interfaces inherited from interface SlotCollection
SlotCollection.Filtered, SlotCollection.FlatMapped, SlotCollection.Limited -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Function<ItemStack, ? extends SlotCollection> The field for themapperrecord component.private final SlotCollectionThe field for theslotsrecord component.Fields inherited from interface SlotCollection
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionFlatMapped(SlotCollection slots, Function<ItemStack, ? extends SlotCollection> mapper) Creates an instance of aFlatMappedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Function<ItemStack, ? extends SlotCollection> mapper()Returns the value of themapperrecord component.slots()Returns the value of theslotsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface SlotCollection
filter, flatMap, limit
-
Field Details
-
slots
The field for theslotsrecord component. -
mapper
The field for themapperrecord component.
-
-
Constructor Details
-
FlatMapped
Creates an instance of aFlatMappedrecord class.- Parameters:
slots- the value for theslotsrecord componentmapper- the value for themapperrecord component
-
-
Method Details
-
itemCopies
- Specified by:
itemCopiesin interfaceSlotCollection
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
slots
Returns the value of theslotsrecord component.- Returns:
- the value of the
slotsrecord component
-
mapper
Returns the value of themapperrecord component.- Returns:
- the value of the
mapperrecord component
-