Record Class ByCostEnchantmentProvider
java.lang.Object
java.lang.Record
net.minecraft.enchantment.provider.ByCostEnchantmentProvider
- Record Components:
- enchantments-
- cost-
- All Implemented Interfaces:
- EnchantmentProvider
public record ByCostEnchantmentProvider(RegistryEntryList<Enchantment> enchantments, IntProvider cost)
extends Record
implements EnchantmentProvider
- Mappings:
- Namespace - Name - named - net/minecraft/enchantment/provider/ByCostEnchantmentProvider- intermediary - net/minecraft/class_9743- official - dek- named - enchantments- intermediary - comp_2764- official - c- named - cost- intermediary - comp_2765- official - d
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ByCostEnchantmentProvider> private final IntProviderThe field for thecostrecord component.private final RegistryEntryList<Enchantment> The field for theenchantmentsrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionByCostEnchantmentProvider(RegistryEntryList<Enchantment> registryEntryList, IntProvider intProvider) 
- 
Method SummaryModifier and TypeMethodDescriptioncost()Returns the value of thecostrecord component.Returns the value of theenchantmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.com.mojang.serialization.MapCodec<ByCostEnchantmentProvider> getCodec()final inthashCode()Returns a hash code value for this object.voidprovideEnchantments(ItemStack stack, ItemEnchantmentsComponent.Builder componentBuilder, Random random, LocalDifficulty localDifficulty) final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
enchantmentsThe field for theenchantmentsrecord component.
- 
costThe field for thecostrecord component.
- 
CODEC- Mappings:
- Namespace - Name - Mixin selector - named - CODEC- Lnet/minecraft/enchantment/provider/ByCostEnchantmentProvider;CODEC:Lcom/mojang/serialization/MapCodec;- intermediary - field_51732- Lnet/minecraft/class_9743;field_51732:Lcom/mojang/serialization/MapCodec;- official - b- Ldek;b:Lcom/mojang/serialization/MapCodec;
 
 
- 
- 
Constructor Details- 
ByCostEnchantmentProviderpublic ByCostEnchantmentProvider(RegistryEntryList<Enchantment> registryEntryList, IntProvider intProvider) 
 
- 
- 
Method Details- 
provideEnchantmentspublic void provideEnchantments(ItemStack stack, ItemEnchantmentsComponent.Builder componentBuilder, Random random, LocalDifficulty localDifficulty) - Specified by:
- provideEnchantmentsin interface- EnchantmentProvider
- Mappings:
- Namespace - Name - Mixin selector - named - provideEnchantments- Lnet/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;)V- intermediary - method_60266- Lnet/minecraft/class_9741;method_60266(Lnet/minecraft/class_1799;Lnet/minecraft/class_9304$class_9305;Lnet/minecraft/class_5819;Lnet/minecraft/class_1266;)V- official - a- Ldei;a(Lcwq;Lddg$a;Lazh;Lbsj;)V
 
- 
getCodec- Specified by:
- getCodecin interface- EnchantmentProvider
- Mappings:
- Namespace - Name - Mixin selector - named - getCodec- Lnet/minecraft/enchantment/provider/EnchantmentProvider;getCodec()Lcom/mojang/serialization/MapCodec;- intermediary - method_60265- Lnet/minecraft/class_9741;method_60265()Lcom/mojang/serialization/MapCodec;- official - a- Ldei;a()Lcom/mojang/serialization/MapCodec;
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
enchantmentsReturns the value of theenchantmentsrecord component.- Returns:
- the value of the enchantmentsrecord component
 
- 
costReturns the value of thecostrecord component.- Returns:
- the value of the costrecord component
 
 
-