Record Class ExchangeValueComponent

java.lang.Object
java.lang.Record
net.minecraft.component.type.ExchangeValueComponent
Record Components:
value -
All Implemented Interfaces:
TooltipAppender

public record ExchangeValueComponent(float value) extends Record implements TooltipAppender
Mappings:
Namespace Name
named net/minecraft/component/type/ExchangeValueComponent
intermediary net/minecraft/class_11054
official dfp
named value
intermediary comp_3943
official c
  • Field Details

    • value

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

      public static final com.mojang.serialization.Codec<ExchangeValueComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/component/type/ExchangeValueComponent;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_58851 Lnet/minecraft/class_11054;field_58851:Lcom/mojang/serialization/Codec;
      official a Ldfp;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<ByteBuf,ExchangeValueComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/ExchangeValueComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_58852 Lnet/minecraft/class_11054;field_58852:Lnet/minecraft/class_9139;
      official b Ldfp;b:Lzg;
  • Constructor Details

    • ExchangeValueComponent

      public ExchangeValueComponent(float float2)
  • Method Details

    • appendTooltip

      public void appendTooltip(Item.TooltipContext context, Consumer<Text> textConsumer, TooltipType type, @Nullable @Nullable PlayerEntity player, ItemStack stack)
      Specified by:
      appendTooltip in interface TooltipAppender
      Mappings:
      Namespace Name Mixin selector
      named appendTooltip Lnet/minecraft/item/tooltip/TooltipAppender;appendTooltip(Lnet/minecraft/item/Item$TooltipContext;Ljava/util/function/Consumer;Lnet/minecraft/item/tooltip/TooltipType;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
      intermediary method_57409 Lnet/minecraft/class_9299;method_57409(Lnet/minecraft/class_1792$class_9635;Ljava/util/function/Consumer;Lnet/minecraft/class_1836;Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
      official a Ldgd;a(Ldco$b;Ljava/util/function/Consumer;Ldek;Lcuf;Ldcs;)V
    • getValue

      public float getValue(@Nullable @Nullable PlayerEntity player, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named getValue Lnet/minecraft/component/type/ExchangeValueComponent;getValue(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)F
      intermediary method_69583 Lnet/minecraft/class_11054;method_69583(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)F
      official a Ldfp;a(Lcuf;Ldcs;)F
    • getValue

      private float getValue(@Nullable @Nullable PlayerEntity player, Iterable<ItemStack> items)
      Mappings:
      Namespace Name Mixin selector
      named getValue Lnet/minecraft/component/type/ExchangeValueComponent;getValue(Lnet/minecraft/entity/player/PlayerEntity;Ljava/lang/Iterable;)F
      intermediary method_69584 Lnet/minecraft/class_11054;method_69584(Lnet/minecraft/class_1657;Ljava/lang/Iterable;)F
      official a Ldfp;a(Lcuf;Ljava/lang/Iterable;)F
    • 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 '=='.
      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.
    • value

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