Record Class ItemDescriptor.MolangDescriptor
java.lang.Object
java.lang.Record
net.raphimc.viabedrock.protocol.model.recipe.ItemDescriptor.MolangDescriptor
- All Implemented Interfaces:
ItemDescriptor
- Enclosing interface:
- ItemDescriptor
public static record ItemDescriptor.MolangDescriptor(String tagExpression, int molangVersion, int amount)
extends Record
implements ItemDescriptor
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.raphimc.viabedrock.protocol.model.recipe.ItemDescriptor
ItemDescriptor.InvalidDescriptor, ItemDescriptor.ItemNameDescriptor, ItemDescriptor.ItemTagDescriptor, ItemDescriptor.MolangDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionMolangDescriptor(String tagExpression, int molangVersion) MolangDescriptor(String tagExpression, int molangVersion, int amount) Creates an instance of aMolangDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.booleanmatchesItem(com.viaversion.viaversion.api.connection.UserConnection user, BedrockItem item) intReturns the value of themolangVersionrecord component.Returns the value of thetagExpressionrecord component.final StringtoString()Returns a string representation of this record class.withAmount(int amount)
-
Constructor Details
-
MolangDescriptor
-
MolangDescriptor
Creates an instance of aMolangDescriptorrecord class.- Parameters:
tagExpression- the value for thetagExpressionrecord componentmolangVersion- the value for themolangVersionrecord componentamount- the value for theamountrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceItemDescriptor
-
matchesItem
public boolean matchesItem(com.viaversion.viaversion.api.connection.UserConnection user, BedrockItem item) - Specified by:
matchesItemin interfaceItemDescriptor
-
withAmount
- Specified by:
withAmountin interfaceItemDescriptor
-
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 '=='. -
tagExpression
Returns the value of thetagExpressionrecord component.- Returns:
- the value of the
tagExpressionrecord component
-
molangVersion
public int molangVersion()Returns the value of themolangVersionrecord component.- Returns:
- the value of the
molangVersionrecord component
-
amount
public int amount()Returns the value of theamountrecord component.- Specified by:
amountin interfaceItemDescriptor- Returns:
- the value of the
amountrecord component
-