Record Class ItemData
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.item.ItemData
- Record Components:
item- the item id, e.g.minecraft:iron_ingotor a CraftEngine item iddata- the serialized single item (never mutated)
public record ItemData(@NotNull net.kyori.adventure.key.Key item, byte @NotNull [] data)
extends Record
Which item a
Items.ITEM resource is: the item id plus the platform's serialized form of
one such item (Paper: ItemStack#serializeAsBytes). Two items stack in a machine exactly
when both are equal.-
Constructor Summary
ConstructorsConstructorDescriptionItemData(@NotNull net.kyori.adventure.key.Key item, byte @NotNull [] data) Creates an instance of aItemDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte @NotNull []data()Returns the value of thedatarecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.@NotNull net.kyori.adventure.key.Keyitem()Returns the value of theitemrecord component.@NotNull StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemData
-
-
Method Details
-
data
-
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 withObjects::equals(Object,Object). -
hashCode
-
toString
-
item
-