Record Class BlockPositionSource

java.lang.Object
java.lang.Record
net.minecraft.world.event.BlockPositionSource
Record Components:
pos -
All Implemented Interfaces:
PositionSource

public record BlockPositionSource(BlockPos pos) extends Record implements PositionSource
Mappings:
Namespace Name
named net/minecraft/world/event/BlockPositionSource
intermediary net/minecraft/class_5707
official eom
named pos
intermediary comp_4878
official e
  • Field Details

    • pos

      private final BlockPos pos
      The field for the pos record component.
    • CODEC

      public static final com.mojang.serialization.MapCodec<BlockPositionSource> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/world/event/BlockPositionSource;CODEC:Lcom/mojang/serialization/MapCodec;
      intermediary field_28137 Lnet/minecraft/class_5707;field_28137:Lcom/mojang/serialization/MapCodec;
      official a Leom;a:Lcom/mojang/serialization/MapCodec;
    • PACKET_CODEC

      public static final PacketCodec<ByteBuf,BlockPositionSource> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/world/event/BlockPositionSource;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_48377 Lnet/minecraft/class_5707;field_48377:Lnet/minecraft/class_9139;
      official b Leom;b:Laae;
  • Constructor Details

    • BlockPositionSource

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

    • getPos

      public Optional<Vec3d> getPos(World world)
      Specified by:
      getPos in interface PositionSource
      Mappings:
      Namespace Name Mixin selector
      named getPos Lnet/minecraft/world/event/PositionSource;getPos(Lnet/minecraft/world/World;)Ljava/util/Optional;
      intermediary method_32956 Lnet/minecraft/class_5716;method_32956(Lnet/minecraft/class_1937;)Ljava/util/Optional;
      official a Leou;a(Ldrq;)Ljava/util/Optional;
    • getType

      Returns the type of this position source.
      Specified by:
      getType in interface PositionSource
      Mappings:
      Namespace Name Mixin selector
      named getType Lnet/minecraft/world/event/PositionSource;getType()Lnet/minecraft/world/event/PositionSourceType;
      intermediary method_32955 Lnet/minecraft/class_5716;method_32955()Lnet/minecraft/class_5717;
      official a Leou;a()Leov;
    • 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.
    • pos

      public BlockPos pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component