Record Class ByCostWithDifficultyEnchantmentProvider
java.lang.Object
java.lang.Record
net.minecraft.enchantment.provider.ByCostWithDifficultyEnchantmentProvider
- Record Components:
- enchantments-
- minCost-
- maxCostSpan-
- All Implemented Interfaces:
- EnchantmentProvider
public record ByCostWithDifficultyEnchantmentProvider(RegistryEntryList<Enchantment> enchantments, int minCost, int maxCostSpan)
extends Record
implements EnchantmentProvider
- Mappings:
- Namespace - Name - named - net/minecraft/enchantment/provider/ByCostWithDifficultyEnchantmentProvider- intermediary - net/minecraft/class_9744- official - del- named - enchantments- intermediary - comp_2766- official - d- named - minCost- intermediary - comp_2767- official - e- named - maxCostSpan- intermediary - comp_2768- official - f
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ByCostWithDifficultyEnchantmentProvider> private final RegistryEntryList<Enchantment> The field for theenchantmentsrecord component.static final intprivate final intThe field for themaxCostSpanrecord component.private final intThe field for theminCostrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionByCostWithDifficultyEnchantmentProvider(RegistryEntryList<Enchantment> registryEntryList, int int2, int int3) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the value of theenchantmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.com.mojang.serialization.MapCodec<ByCostWithDifficultyEnchantmentProvider> getCodec()final inthashCode()Returns a hash code value for this object.intReturns the value of themaxCostSpanrecord component.intminCost()Returns the value of theminCostrecord component.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.
- 
minCostprivate final int minCostThe field for theminCostrecord component.
- 
maxCostSpanprivate final int maxCostSpanThe field for themaxCostSpanrecord component.
- 
MAX_COSTpublic static final int MAX_COST- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - MAX_COST- Lnet/minecraft/enchantment/provider/ByCostWithDifficultyEnchantmentProvider;MAX_COST:I- intermediary - field_52056- Lnet/minecraft/class_9744;field_52056:I- official - b- Ldel;b:I
 
- 
CODECpublic static final com.mojang.serialization.MapCodec<ByCostWithDifficultyEnchantmentProvider> CODEC- Mappings:
- Namespace - Name - Mixin selector - named - CODEC- Lnet/minecraft/enchantment/provider/ByCostWithDifficultyEnchantmentProvider;CODEC:Lcom/mojang/serialization/MapCodec;- intermediary - field_51733- Lnet/minecraft/class_9744;field_51733:Lcom/mojang/serialization/MapCodec;- official - c- Ldel;c:Lcom/mojang/serialization/MapCodec;
 
 
- 
- 
Constructor Details- 
ByCostWithDifficultyEnchantmentProviderpublic ByCostWithDifficultyEnchantmentProvider(RegistryEntryList<Enchantment> registryEntryList, int int2, int int3) 
 
- 
- 
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
enchantmentsReturns the value of theenchantmentsrecord component.- Returns:
- the value of the enchantmentsrecord component
 
- 
minCostpublic int minCost()Returns the value of theminCostrecord component.- Returns:
- the value of the minCostrecord component
 
- 
maxCostSpanpublic int maxCostSpan()Returns the value of themaxCostSpanrecord component.- Returns:
- the value of the maxCostSpanrecord component
 
 
-