Package net.minecraft.world.item.slot
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 net.minecraft.world.item.slot.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 net.minecraft.world.item.slot.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 p_461097_) 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
-
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
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 '=='. -
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
-