Package api.entity.mob.villager
Record Class TradeItem
java.lang.Object
java.lang.Record
api.entity.mob.villager.TradeItem
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTradeItem(int id, int metadata, int minCount, int maxCount) Creates an instance of aTradeItemrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static TradeItemfromID(int id) static TradeItemfromID(int id, int count) static TradeItemfromID(int id, int minCount, int maxCount) static TradeItemfromIDAndMetadata(int id, int metadata) static TradeItemfromIDAndMetadata(int id, int metadata, int count) static TradeItemfromIDAndMetadata(int id, int metadata, int minCount, int maxCount) final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.booleanisEmpty()intmaxCount()Returns the value of themaxCountrecord component.intmetadata()Returns the value of themetadatarecord component.intminCount()Returns the value of theminCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
TradeItem
public TradeItem(int id, int metadata, int minCount, int maxCount) Creates an instance of aTradeItemrecord class.- Parameters:
id- the value for theidrecord componentmetadata- the value for themetadatarecord componentminCount- the value for theminCountrecord componentmaxCount- the value for themaxCountrecord component
-
-
Method Details
-
fromID
-
fromID
-
fromID
-
fromIDAndMetadata
-
fromIDAndMetadata
-
fromIDAndMetadata
-
isEmpty
public boolean isEmpty() -
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 with '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
metadata
public int metadata()Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
minCount
public int minCount()Returns the value of theminCountrecord component.- Returns:
- the value of the
minCountrecord component
-
maxCount
public int maxCount()Returns the value of themaxCountrecord component.- Returns:
- the value of the
maxCountrecord component
-