Record Class ItemData
java.lang.Object
java.lang.Record
com.zenith.mc.item.ItemData
- All Implemented Interfaces:
RegistryData
public record ItemData(int id, String name, int stackSize, @Nullable ToolTag toolTag)
extends Record
implements RegistryData
-
Constructor Summary
Constructors -
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.intid()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.intReturns the value of thestackSizerecord component.@Nullable ToolTagtoolTag()Returns the value of thetoolTagrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemData
-
ItemData
Creates an instance of aItemDatarecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentstackSize- the value for thestackSizerecord componenttoolTag- the value for thetoolTagrecord component
-
-
Method Details
-
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. -
id
public int id()Returns the value of theidrecord component.- Specified by:
idin interfaceRegistryData- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceRegistryData- Returns:
- the value of the
namerecord component
-
stackSize
public int stackSize()Returns the value of thestackSizerecord component.- Returns:
- the value of the
stackSizerecord component
-
toolTag
Returns the value of thetoolTagrecord component.- Returns:
- the value of the
toolTagrecord component
-