Package cn.nukkit.level.terra.delegate
Record Class PNXItemMeta
java.lang.Object
java.lang.Record
cn.nukkit.level.terra.delegate.PNXItemMeta
- All Implemented Interfaces:
com.dfsek.terra.api.Handle
,com.dfsek.terra.api.inventory.item.ItemMeta
@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public record PNXItemMeta(Item innerItem)
extends Record
implements com.dfsek.terra.api.inventory.item.ItemMeta
-
Constructor Summary
ConstructorDescriptionPNXItemMeta
(Item innerItem) Creates an instance of aPNXItemMeta
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnchantment
(com.dfsek.terra.api.inventory.item.Enchantment enchantment, int i) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinnerItem
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PNXItemMeta
Creates an instance of aPNXItemMeta
record class.- Parameters:
innerItem
- the value for theinnerItem
record component
-
-
Method Details
-
addEnchantment
public void addEnchantment(com.dfsek.terra.api.inventory.item.Enchantment enchantment, int i) - Specified by:
addEnchantment
in interfacecom.dfsek.terra.api.inventory.item.ItemMeta
-
getEnchantments
- Specified by:
getEnchantments
in interfacecom.dfsek.terra.api.inventory.item.ItemMeta
-
getHandle
- Specified by:
getHandle
in interfacecom.dfsek.terra.api.Handle
-
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 withObjects::equals(Object,Object)
. -
innerItem
Returns the value of theinnerItem
record component.- Returns:
- the value of the
innerItem
record component
-