Record Class ToolComponent.Rule

java.lang.Object
java.lang.Record
net.minecraft.component.type.ToolComponent.Rule
Record Components:
blocks -
speed -
correctForDrops -
Enclosing class:
ToolComponent

public static record ToolComponent.Rule(RegistryEntryList<Block> blocks, Optional<Float> speed, Optional<Boolean> correctForDrops) extends Record
Mappings:
Namespace Name
named net/minecraft/component/type/ToolComponent$Rule
intermediary net/minecraft/class_9424$class_9425
official cxv$a
named blocks
intermediary comp_2501
official c
named speed
intermediary comp_2502
official d
named correctForDrops
intermediary comp_2503
official e
  • Field Details

    • blocks

      private final RegistryEntryList<Block> blocks
      The field for the blocks record component.
    • speed

      private final Optional<Float> speed
      The field for the speed record component.
    • correctForDrops

      private final Optional<Boolean> correctForDrops
      The field for the correctForDrops record component.
    • CODEC

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

      public static final PacketCodec<RegistryByteBuf,ToolComponent.Rule> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/ToolComponent$Rule;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_50012 Lnet/minecraft/class_9424$class_9425;field_50012:Lnet/minecraft/class_9139;
      official b Lcxv$a;b:Lzn;
  • Constructor Details

  • Method Details

    • ofAlwaysDropping

      public static ToolComponent.Rule ofAlwaysDropping(List<Block> blocks, float speed)
      Mappings:
      Namespace Name Mixin selector
      named ofAlwaysDropping Lnet/minecraft/component/type/ToolComponent$Rule;ofAlwaysDropping(Ljava/util/List;F)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58431 Lnet/minecraft/class_9424$class_9425;method_58431(Ljava/util/List;F)Lnet/minecraft/class_9424$class_9425;
      official a Lcxv$a;a(Ljava/util/List;F)Lcxv$a;
    • ofAlwaysDropping

      public static ToolComponent.Rule ofAlwaysDropping(TagKey<Block> blocks, float speed)
      Mappings:
      Namespace Name Mixin selector
      named ofAlwaysDropping Lnet/minecraft/component/type/ToolComponent$Rule;ofAlwaysDropping(Lnet/minecraft/registry/tag/TagKey;F)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58428 Lnet/minecraft/class_9424$class_9425;method_58428(Lnet/minecraft/class_6862;F)Lnet/minecraft/class_9424$class_9425;
      official a Lcxv$a;a(Laxf;F)Lcxv$a;
    • ofNeverDropping

      public static ToolComponent.Rule ofNeverDropping(TagKey<Block> tag)
      Mappings:
      Namespace Name Mixin selector
      named ofNeverDropping Lnet/minecraft/component/type/ToolComponent$Rule;ofNeverDropping(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58427 Lnet/minecraft/class_9424$class_9425;method_58427(Lnet/minecraft/class_6862;)Lnet/minecraft/class_9424$class_9425;
      official a Lcxv$a;a(Laxf;)Lcxv$a;
    • of

      public static ToolComponent.Rule of(TagKey<Block> tag, float speed)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/component/type/ToolComponent$Rule;of(Lnet/minecraft/registry/tag/TagKey;F)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58433 Lnet/minecraft/class_9424$class_9425;method_58433(Lnet/minecraft/class_6862;F)Lnet/minecraft/class_9424$class_9425;
      official b Lcxv$a;b(Laxf;F)Lcxv$a;
    • of

      public static ToolComponent.Rule of(List<Block> blocks, float speed)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/component/type/ToolComponent$Rule;of(Ljava/util/List;F)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58434 Lnet/minecraft/class_9424$class_9425;method_58434(Ljava/util/List;F)Lnet/minecraft/class_9424$class_9425;
      official b Lcxv$a;b(Ljava/util/List;F)Lcxv$a;
    • of

      private static ToolComponent.Rule of(TagKey<Block> tag, Optional<Float> speed, Optional<Boolean> correctForDrops)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/component/type/ToolComponent$Rule;of(Lnet/minecraft/registry/tag/TagKey;Ljava/util/Optional;Ljava/util/Optional;)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58429 Lnet/minecraft/class_9424$class_9425;method_58429(Lnet/minecraft/class_6862;Ljava/util/Optional;Ljava/util/Optional;)Lnet/minecraft/class_9424$class_9425;
      official a Lcxv$a;a(Laxf;Ljava/util/Optional;Ljava/util/Optional;)Lcxv$a;
    • of

      private static ToolComponent.Rule of(List<Block> blocks, Optional<Float> speed, Optional<Boolean> correctForDrops)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/component/type/ToolComponent$Rule;of(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)Lnet/minecraft/component/type/ToolComponent$Rule;
      intermediary method_58432 Lnet/minecraft/class_9424$class_9425;method_58432(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)Lnet/minecraft/class_9424$class_9425;
      official a Lcxv$a;a(Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)Lcxv$a;
    • 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.
    • blocks

      public RegistryEntryList<Block> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component
    • speed

      public Optional<Float> speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component
    • correctForDrops

      public Optional<Boolean> correctForDrops()
      Returns the value of the correctForDrops record component.
      Returns:
      the value of the correctForDrops record component