Package net.minecraft.component.type
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 cxx
named rules
intermediary comp_2498
official c
named defaultMiningSpeed
intermediary comp_2499
official d
named damagePerBlock
intermediary comp_2500
official e
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ToolComponent> private final int
The field for thedamagePerBlock
record component.private final float
The field for thedefaultMiningSpeed
record component.static final PacketCodec
<RegistryByteBuf, ToolComponent> private final List
<ToolComponent.Rule> The field for therules
record component. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thedamagePerBlock
record component.float
Returns the value of thedefaultMiningSpeed
record component.final boolean
Indicates whether some other object is "equal to" this one.float
getSpeed
(BlockState state) final int
hashCode()
Returns a hash code value for this object.boolean
isCorrectForDrops
(BlockState state) rules()
Returns the value of therules
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
rules
The field for therules
record component. -
defaultMiningSpeed
private final float defaultMiningSpeedThe field for thedefaultMiningSpeed
record component. -
damagePerBlock
private final int damagePerBlockThe field for thedamagePerBlock
record component. -
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
Lcxx;a:Lcom/mojang/serialization/Codec;
-
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
Lcxx;b:Lyx;
-
-
Constructor Details
-
ToolComponent
-
-
Method Details
-
getSpeed
- 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
Lcxx;a(Ldtc;)F
-
isCorrectForDrops
- 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
Lcxx;b(Ldtc;)Z
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
rules
Returns the value of therules
record component.- Returns:
- the value of the
rules
record component
-
defaultMiningSpeed
public float defaultMiningSpeed()Returns the value of thedefaultMiningSpeed
record component.- Returns:
- the value of the
defaultMiningSpeed
record component
-
damagePerBlock
public int damagePerBlock()Returns the value of thedamagePerBlock
record component.- Returns:
- the value of the
damagePerBlock
record component
-