Package net.minecraft.world.item.slot
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 net.minecraft.world.item.slot.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 net.minecraft.world.item.slot.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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.slot.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
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. 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
-