Record Class ToolComponent

java.lang.Object
java.lang.Record
net.minecraft.component.type.ToolComponent
Record Components:
rules -
defaultMiningSpeed -
damagePerBlock -

public record ToolComponent(List<ToolComponent.Rule> rules, float defaultMiningSpeed, int damagePerBlock) extends Record
Mappings:
Namespace Name
named net/minecraft/component/type/ToolComponent
intermediary net/minecraft/class_9424
official cxh
named rules
intermediary comp_2498
official c
named defaultMiningSpeed
intermediary comp_2499
official d
named damagePerBlock
intermediary comp_2500
official e
  • Field Details

    • rules

      private final List<ToolComponent.Rule> rules
      The field for the rules record component.
    • defaultMiningSpeed

      private final float defaultMiningSpeed
      The field for the defaultMiningSpeed record component.
    • damagePerBlock

      private final int damagePerBlock
      The field for the damagePerBlock record component.
    • CODEC

      public static final com.mojang.serialization.Codec<ToolComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/component/type/ToolComponent;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_50009 Lnet/minecraft/class_9424;field_50009:Lcom/mojang/serialization/Codec;
      official a Lcxh;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,ToolComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/ToolComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_50010 Lnet/minecraft/class_9424;field_50010:Lnet/minecraft/class_9139;
      official b Lcxh;b:Lys;
  • Constructor Details

  • Method Details

    • getSpeed

      public float getSpeed(BlockState state)
      Mappings:
      Namespace Name Mixin selector
      named getSpeed Lnet/minecraft/component/type/ToolComponent;getSpeed(Lnet/minecraft/block/BlockState;)F
      intermediary method_58425 Lnet/minecraft/class_9424;method_58425(Lnet/minecraft/class_2680;)F
      official a Lcxh;a(Ldsl;)F
    • isCorrectForDrops

      public boolean isCorrectForDrops(BlockState state)
      Mappings:
      Namespace Name Mixin selector
      named isCorrectForDrops Lnet/minecraft/component/type/ToolComponent;isCorrectForDrops(Lnet/minecraft/block/BlockState;)Z
      intermediary method_58426 Lnet/minecraft/class_9424;method_58426(Lnet/minecraft/class_2680;)Z
      official b Lcxh;b(Ldsl;)Z
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • rules

      public List<ToolComponent.Rule> rules()
      Returns the value of the rules record component.
      Returns:
      the value of the rules record component
    • defaultMiningSpeed

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

      public int damagePerBlock()
      Returns the value of the damagePerBlock record component.
      Returns:
      the value of the damagePerBlock record component