Record Class SlotCollection.Limited
java.lang.Object
java.lang.Record
net.minecraft.world.item.slot.SlotCollection.Limited
- All Implemented Interfaces:
SlotCollection
- Enclosing interface:
SlotCollection
public static record SlotCollection.Limited(SlotCollection slots, int limit)
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 intThe field for thelimitrecord component.private final SlotCollectionThe field for theslotsrecord component.Fields inherited from interface SlotCollection
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionLimited(SlotCollection slots, int limit) Creates an instance of aLimitedrecord 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.intlimit()Returns the value of thelimitrecord component.limit(int limit) slots()Returns the value of theslotsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface SlotCollection
filter, flatMap
-
Field Details
-
slots
The field for theslotsrecord component. -
limit
private final int limitThe field for thelimitrecord component.
-
-
Constructor Details
-
Limited
Creates an instance of aLimitedrecord class.- Parameters:
slots- the value for theslotsrecord componentlimit- the value for thelimitrecord component
-
-
Method Details
-
itemCopies
- Specified by:
itemCopiesin interfaceSlotCollection
-
limit
- Specified by:
limitin 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
slots
Returns the value of theslotsrecord component.- Returns:
- the value of the
slotsrecord component
-
limit
public int limit()Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-