Record Class Enchantment
java.lang.Object
java.lang.Record
org.geysermc.geyser.item.enchantment.Enchantment
- Record Components:
description- only populated ifbedrockEnchantment()is not null.anvilCost- also as a rarity multiplier
public record Enchantment(String identifier, Set<EnchantmentComponent> effects, ItemTag supportedItems, int maxLevel, String description, int anvilCost, @Nullable EnchantmentTag exclusiveSet, @Nullable BedrockEnchantment bedrockEnchantment)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionEnchantment(String identifier, Set<EnchantmentComponent> effects, ItemTag supportedItems, int maxLevel, String description, int anvilCost, @Nullable EnchantmentTag exclusiveSet, @Nullable BedrockEnchantment bedrockEnchantment) Creates an instance of aEnchantmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theanvilCostrecord component.@Nullable BedrockEnchantmentReturns the value of thebedrockEnchantmentrecord component.Returns the value of thedescriptionrecord component.effects()Returns the value of theeffectsrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable EnchantmentTagReturns the value of theexclusiveSetrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theidentifierrecord component.intmaxLevel()Returns the value of themaxLevelrecord component.static Enchantmentread(org.geysermc.mcprotocollib.protocol.data.game.RegistryEntry entry) Returns the value of thesupportedItemsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Enchantment
public Enchantment(String identifier, Set<EnchantmentComponent> effects, ItemTag supportedItems, int maxLevel, String description, int anvilCost, @Nullable EnchantmentTag exclusiveSet, @Nullable BedrockEnchantment bedrockEnchantment) Creates an instance of aEnchantmentrecord class.- Parameters:
identifier- the value for theidentifierrecord componenteffects- the value for theeffectsrecord componentsupportedItems- the value for thesupportedItemsrecord componentmaxLevel- the value for themaxLevelrecord componentdescription- the value for thedescriptionrecord componentanvilCost- the value for theanvilCostrecord componentexclusiveSet- the value for theexclusiveSetrecord componentbedrockEnchantment- the value for thebedrockEnchantmentrecord component
-
-
Method Details
-
read
-
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 '=='. -
identifier
Returns the value of theidentifierrecord component.- Returns:
- the value of the
identifierrecord component
-
effects
Returns the value of theeffectsrecord component.- Returns:
- the value of the
effectsrecord component
-
supportedItems
Returns the value of thesupportedItemsrecord component.- Returns:
- the value of the
supportedItemsrecord component
-
maxLevel
public int maxLevel()Returns the value of themaxLevelrecord component.- Returns:
- the value of the
maxLevelrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
anvilCost
public int anvilCost()Returns the value of theanvilCostrecord component.- Returns:
- the value of the
anvilCostrecord component
-
exclusiveSet
Returns the value of theexclusiveSetrecord component.- Returns:
- the value of the
exclusiveSetrecord component
-
bedrockEnchantment
Returns the value of thebedrockEnchantmentrecord component.- Returns:
- the value of the
bedrockEnchantmentrecord component
-