Package net.minestom.server.registry
Record Class Registry.EnchantmentEntry
java.lang.Object
java.lang.Record
net.minestom.server.registry.Registry.EnchantmentEntry
- All Implemented Interfaces:
Registry.Entry
- Enclosing class:
Registry
public static record Registry.EnchantmentEntry(NamespaceID namespace, int id, String translationKey, double maxLevel, boolean isCursed, boolean isDiscoverable, boolean isTradeable, boolean isTreasureOnly, Registry.Properties custom)
extends Record
implements Registry.Entry
-
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentEntry(String namespace, Registry.Properties main, Registry.Properties custom) EnchantmentEntry(NamespaceID namespace, int id, String translationKey, double maxLevel, boolean isCursed, boolean isDiscoverable, boolean isTradeable, boolean isTreasureOnly, Registry.Properties custom) Creates an instance of aEnchantmentEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncustom()Returns the value of thecustomrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.booleanisCursed()Returns the value of theisCursedrecord component.booleanReturns the value of theisDiscoverablerecord component.booleanReturns the value of theisTradeablerecord component.booleanReturns the value of theisTreasureOnlyrecord component.doublemaxLevel()Returns the value of themaxLevelrecord component.Returns the value of thenamespacerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.
-
Constructor Details
-
EnchantmentEntry
-
EnchantmentEntry
public EnchantmentEntry(NamespaceID namespace, int id, String translationKey, double maxLevel, boolean isCursed, boolean isDiscoverable, boolean isTradeable, boolean isTreasureOnly, Registry.Properties custom) Creates an instance of aEnchantmentEntryrecord class.- Parameters:
namespace- the value for thenamespacerecord componentid- the value for theidrecord componenttranslationKey- the value for thetranslationKeyrecord componentmaxLevel- the value for themaxLevelrecord componentisCursed- the value for theisCursedrecord componentisDiscoverable- the value for theisDiscoverablerecord componentisTradeable- the value for theisTradeablerecord componentisTreasureOnly- the value for theisTreasureOnlyrecord componentcustom- the value for thecustomrecord 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 '=='. -
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
translationKey
Returns the value of thetranslationKeyrecord component.- Returns:
- the value of the
translationKeyrecord component
-
maxLevel
public double maxLevel()Returns the value of themaxLevelrecord component.- Returns:
- the value of the
maxLevelrecord component
-
isCursed
public boolean isCursed()Returns the value of theisCursedrecord component.- Returns:
- the value of the
isCursedrecord component
-
isDiscoverable
public boolean isDiscoverable()Returns the value of theisDiscoverablerecord component.- Returns:
- the value of the
isDiscoverablerecord component
-
isTradeable
public boolean isTradeable()Returns the value of theisTradeablerecord component.- Returns:
- the value of the
isTradeablerecord component
-
isTreasureOnly
public boolean isTreasureOnly()Returns the value of theisTreasureOnlyrecord component.- Returns:
- the value of the
isTreasureOnlyrecord component
-
custom
Returns the value of thecustomrecord component.- Specified by:
customin interfaceRegistry.Entry- Returns:
- the value of the
customrecord component
-