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/SingleEnchantmentProvider
intermediary net/minecraft/class_9745
official dfk
named enchantment
intermediary comp_2769
official c
named level
intermediary comp_2770
official d
  • Field Details

    • enchantment

      private final RegistryEntry<Enchantment> enchantment
      The field for the enchantment record component.
    • level

      private final IntProvider level
      The field for the level record component.
    • CODEC

      public static final com.mojang.serialization.MapCodec<SingleEnchantmentProvider> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/enchantment/provider/SingleEnchantmentProvider;CODEC:Lcom/mojang/serialization/MapCodec;
      intermediary field_51734 Lnet/minecraft/class_9745;field_51734:Lcom/mojang/serialization/MapCodec;
      official b Ldfk;b:Lcom/mojang/serialization/MapCodec;
  • Constructor Details

  • Method Details

    • provideEnchantments

      public void provideEnchantments(ItemStack stack, ItemEnchantmentsComponent.Builder componentBuilder, Random random, LocalDifficulty localDifficulty)
      Specified by:
      provideEnchantments in 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 Ldfg;a(Lcxo;Ldee$a;Lbam;Lbtg;)V
    • getCodec

      public com.mojang.serialization.MapCodec<SingleEnchantmentProvider> getCodec()
      Specified by:
      getCodec in 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 Ldfg;a()Lcom/mojang/serialization/MapCodec;
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • enchantment

      public RegistryEntry<Enchantment> enchantment()
      Returns the value of the enchantment record component.
      Returns:
      the value of the enchantment record component
    • level

      public IntProvider level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component