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