Record Class HorizontalBlockPos

java.lang.Object
java.lang.Record
com.petrolpark.util.HorizontalBlockPos

public record HorizontalBlockPos(int x, int z) extends Record
  • Field Details

    • CODEC

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

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,HorizontalBlockPos> STREAM_CODEC
  • Constructor Details

    • HorizontalBlockPos

      public HorizontalBlockPos(int x, int z)
      Creates an instance of a HorizontalBlockPos record class.
      Parameters:
      x - the value for the x record component
      z - the value for the z record component
  • Method Details

    • of

      public static HorizontalBlockPos of(net.minecraft.core.BlockPos pos)
    • is

      public boolean is(net.minecraft.core.BlockPos pos)
    • offset

      public HorizontalBlockPos offset(int x, int z)
    • offset

      public HorizontalBlockPos offset(HorizontalBlockPos vector)
    • subtract

      public HorizontalBlockPos subtract(HorizontalBlockPos vector)
    • multiply

      public HorizontalBlockPos multiply(int scalar)
    • north

      public HorizontalBlockPos north()
    • north

      public HorizontalBlockPos north(int distance)
    • south

      public HorizontalBlockPos south()
    • south

      public HorizontalBlockPos south(int distance)
    • west

      public HorizontalBlockPos west()
    • west

      public HorizontalBlockPos west(int distance)
    • east

      public HorizontalBlockPos east()
    • east

      public HorizontalBlockPos east(int distance)
    • relative

      public HorizontalBlockPos relative(net.minecraft.core.Direction direction)
    • relative

      public HorizontalBlockPos relative(net.minecraft.core.Direction direction, int distance)
    • rotate

      public HorizontalBlockPos rotate(net.minecraft.world.level.block.Rotation rotation)
    • distanceToSqr

      public int distanceToSqr(HorizontalBlockPos pos)
    • closest

      public Optional<HorizontalBlockPos> closest(Collection<HorizontalBlockPos> otherPositions)
    • equals

      public final boolean equals(Object obj)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • 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
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • z

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