Record Class ConstantLootNumberProvider

java.lang.Object
java.lang.Record
net.minecraft.loot.provider.number.ConstantLootNumberProvider
Record Components:
value -
All Implemented Interfaces:
LootContextAware, LootNumberProvider

public record ConstantLootNumberProvider(float value) extends Record implements LootNumberProvider
Mappings:
Namespace Name
official eko
intermediary net/minecraft/class_44
named net/minecraft/loot/provider/number/ConstantLootNumberProvider
official c
intermediary comp_1895
named value
  • Field Details

    • value

      private final float value
      The field for the value record component.
    • CODEC

      public static final com.mojang.serialization.Codec<ConstantLootNumberProvider> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Leko;a:Lcom/mojang/serialization/Codec;
      intermediary field_45886 Lnet/minecraft/class_44;field_45886:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/loot/provider/number/ConstantLootNumberProvider;CODEC:Lcom/mojang/serialization/Codec;
    • INLINE_CODEC

      public static final com.mojang.serialization.Codec<ConstantLootNumberProvider> INLINE_CODEC
      Mappings:
      Namespace Name Mixin selector
      official b Leko;b:Lcom/mojang/serialization/Codec;
      intermediary field_45887 Lnet/minecraft/class_44;field_45887:Lcom/mojang/serialization/Codec;
      named INLINE_CODEC Lnet/minecraft/loot/provider/number/ConstantLootNumberProvider;INLINE_CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • ConstantLootNumberProvider

      public ConstantLootNumberProvider(float value)
      Creates an instance of a ConstantLootNumberProvider record class.
      Parameters:
      value - the value for the value record component
  • Method Details

    • getType

      public LootNumberProviderType getType()
      Specified by:
      getType in interface LootNumberProvider
      Mappings:
      Namespace Name Mixin selector
      official b Lekq;b()Lekp;
      intermediary method_365 Lnet/minecraft/class_5658;method_365()Lnet/minecraft/class_5657;
      named getType Lnet/minecraft/loot/provider/number/LootNumberProvider;getType()Lnet/minecraft/loot/provider/number/LootNumberProviderType;
    • nextFloat

      public float nextFloat(LootContext context)
      Specified by:
      nextFloat in interface LootNumberProvider
      Mappings:
      Namespace Name Mixin selector
      official b Lekq;b(Legw;)F
      intermediary method_32454 Lnet/minecraft/class_5658;method_32454(Lnet/minecraft/class_47;)F
      named nextFloat Lnet/minecraft/loot/provider/number/LootNumberProvider;nextFloat(Lnet/minecraft/loot/context/LootContext;)F
    • create

      public static ConstantLootNumberProvider create(float value)
      Mappings:
      Namespace Name Mixin selector
      official a Leko;a(F)Leko;
      intermediary method_32448 Lnet/minecraft/class_44;method_32448(F)Lnet/minecraft/class_44;
      named create Lnet/minecraft/loot/provider/number/ConstantLootNumberProvider;create(F)Lnet/minecraft/loot/provider/number/ConstantLootNumberProvider;
    • equals

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

      public 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
    • 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
    • value

      public float value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component