Record Class ClipPosition

java.lang.Object
java.lang.Record
dev.latvian.mods.klib.math.ClipPosition

public record ClipPosition(net.minecraft.world.phys.Vec3 position, net.minecraft.core.BlockPos blockPosition, net.minecraft.core.Direction side) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<ClipPosition>
     
    static final DataType<ClipPosition>
     
    static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,ClipPosition>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ClipPosition(net.minecraft.world.phys.BlockHitResult hit)
     
    ClipPosition(net.minecraft.world.phys.Vec3 position, net.minecraft.core.BlockPos blockPosition, net.minecraft.core.Direction side)
    Creates an instance of a ClipPosition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.core.BlockPos
    Returns the value of the blockPosition record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.phys.Vec3
     
    net.minecraft.world.phys.Vec3
     
    net.minecraft.core.BlockPos
     
    final int
    Returns a hash code value for this object.
    net.minecraft.world.phys.Vec3
    Returns the value of the position record component.
    net.minecraft.core.Direction
    Returns the value of the side record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ClipPosition> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,ClipPosition> STREAM_CODEC
    • DATA_TYPE

      public static final DataType<ClipPosition> DATA_TYPE
  • Constructor Details

    • ClipPosition

      public ClipPosition(net.minecraft.world.phys.BlockHitResult hit)
    • ClipPosition

      public ClipPosition(net.minecraft.world.phys.Vec3 position, net.minecraft.core.BlockPos blockPosition, net.minecraft.core.Direction side)
      Creates an instance of a ClipPosition record class.
      Parameters:
      position - the value for the position record component
      blockPosition - the value for the blockPosition record component
      side - the value for the side record component
  • Method Details

    • getOffsetBlockPosition

      public net.minecraft.core.BlockPos getOffsetBlockPosition()
    • getBottomCenter

      public net.minecraft.world.phys.Vec3 getBottomCenter()
    • getCenter

      public net.minecraft.world.phys.Vec3 getCenter()
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • position

      public net.minecraft.world.phys.Vec3 position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • blockPosition

      public net.minecraft.core.BlockPos blockPosition()
      Returns the value of the blockPosition record component.
      Returns:
      the value of the blockPosition record component
    • side

      public net.minecraft.core.Direction side()
      Returns the value of the side record component.
      Returns:
      the value of the side record component