Package api.achievement
Record Class AchievementEvents.EnchantEventData
java.lang.Object
java.lang.Record
api.achievement.AchievementEvents.EnchantEventData
- Enclosing class:
- AchievementEvents
public static record AchievementEvents.EnchantEventData(ItemStack stack, Enchantment enchant, int enchantLevel, int xpSpent)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionEnchantEventData(ItemStack stack, Enchantment enchant, int enchantLevel, int xpSpent) Creates an instance of aEnchantEventDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionenchant()Returns the value of theenchantrecord component.intReturns the value of theenchantLevelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.stack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.intxpSpent()Returns the value of thexpSpentrecord component.
-
Constructor Details
-
EnchantEventData
Creates an instance of aEnchantEventDatarecord class.- Parameters:
stack- the value for thestackrecord componentenchant- the value for theenchantrecord componentenchantLevel- the value for theenchantLevelrecord componentxpSpent- the value for thexpSpentrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
stack
Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
enchant
Returns the value of theenchantrecord component.- Returns:
- the value of the
enchantrecord component
-
enchantLevel
public int enchantLevel()Returns the value of theenchantLevelrecord component.- Returns:
- the value of the
enchantLevelrecord component
-
xpSpent
public int xpSpent()Returns the value of thexpSpentrecord component.- Returns:
- the value of the
xpSpentrecord component
-