Record Class SingleEnchantmentProvider
java.lang.Object
java.lang.Record
net.minecraft.enchantment.provider.SingleEnchantmentProvider
- Record Components:
enchantment-level-
- All Implemented Interfaces:
EnchantmentProvider
public record SingleEnchantmentProvider(RegistryEntry<Enchantment> enchantment, IntProvider level)
extends Record
implements EnchantmentProvider
- Mappings:
Namespace Name named net/minecraft/enchantment/provider/SingleEnchantmentProviderintermediary net/minecraft/class_9745official dbnnamed enchantmentintermediary comp_2769official cnamed levelintermediary comp_2770official d
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SingleEnchantmentProvider> private final RegistryEntry<Enchantment> The field for theenchantmentrecord component.private final IntProviderThe field for thelevelrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSingleEnchantmentProvider(RegistryEntry<Enchantment> registryEntry, IntProvider intProvider) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenchantmentrecord component.final booleanIndicates whether some other object is "equal to" this one.com.mojang.serialization.MapCodec<SingleEnchantmentProvider> getCodec()final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.voidprovideEnchantments(ItemStack stack, ItemEnchantmentsComponent.Builder componentBuilder, Random random, LocalDifficulty localDifficulty) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
enchantment
The field for theenchantmentrecord component. -
level
The field for thelevelrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/enchantment/provider/SingleEnchantmentProvider;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_51734Lnet/minecraft/class_9745;field_51734:Lcom/mojang/serialization/MapCodec;official bLdbn;b:Lcom/mojang/serialization/MapCodec;
-
-
Constructor Details
-
SingleEnchantmentProvider
-
-
Method Details
-
provideEnchantments
public void provideEnchantments(ItemStack stack, ItemEnchantmentsComponent.Builder componentBuilder, Random random, LocalDifficulty localDifficulty) - Specified by:
provideEnchantmentsin interfaceEnchantmentProvider- Mappings:
Namespace Name Mixin selector named provideEnchantmentsLnet/minecraft/enchantment/provider/EnchantmentProvider;provideEnchantments(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/ItemEnchantmentsComponent$Builder;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/world/LocalDifficulty;)Vintermediary method_60266Lnet/minecraft/class_9741;method_60266(Lnet/minecraft/class_1799;Lnet/minecraft/class_9304$class_9305;Lnet/minecraft/class_5819;Lnet/minecraft/class_1266;)Vofficial aLdbj;a(Lcuq;Ldai$a;Layw;Lbqp;)V
-
getCodec
- Specified by:
getCodecin interfaceEnchantmentProvider- Mappings:
Namespace Name Mixin selector named getCodecLnet/minecraft/enchantment/provider/EnchantmentProvider;getCodec()Lcom/mojang/serialization/MapCodec;intermediary method_60265Lnet/minecraft/class_9741;method_60265()Lcom/mojang/serialization/MapCodec;official aLdbj;a()Lcom/mojang/serialization/MapCodec;
-
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). -
enchantment
Returns the value of theenchantmentrecord component.- Returns:
- the value of the
enchantmentrecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-