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, DataComponents components, EnumSet<ItemTags> itemTags, @Nullable ToolTag toolTag)
extends Record
implements RegistryData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.final 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.itemTags()Returns the value of theitemTagsrecord component.name()Returns the value of thenamerecord component.int@Nullable ToolTagtoolTag()Returns the value of thetoolTagrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemData
public ItemData(int id, String name, DataComponents components, EnumSet<ItemTags> itemTags, @Nullable ToolTag toolTag) Creates an instance of aItemDatarecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentcomponents- the value for thecomponentsrecord componentitemTags- the value for theitemTagsrecord componenttoolTag- the value for thetoolTagrecord component
-
-
Method Details
-
stackSize
public int stackSize() -
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
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-
itemTags
-
toolTag
Returns the value of thetoolTagrecord component.- Returns:
- the value of the
toolTagrecord component
-