Package com.petrolpark.util
Record Class HorizontalBlockPos
java.lang.Object
java.lang.Record
com.petrolpark.util.HorizontalBlockPos
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<HorizontalBlockPos> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, HorizontalBlockPos> -
Constructor Summary
ConstructorsConstructorDescriptionHorizontalBlockPos(int x, int z) Creates an instance of aHorizontalBlockPosrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclosest(Collection<HorizontalBlockPos> otherPositions) inteast()east(int distance) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanis(net.minecraft.core.BlockPos pos) multiply(int scalar) north()north(int distance) static HorizontalBlockPosof(net.minecraft.core.BlockPos pos) offset(int x, int z) offset(HorizontalBlockPos vector) relative(net.minecraft.core.Direction direction) relative(net.minecraft.core.Direction direction, int distance) rotate(net.minecraft.world.level.block.Rotation rotation) south()south(int distance) subtract(HorizontalBlockPos vector) final StringtoString()Returns a string representation of this record class.west()west(int distance) intx()Returns the value of thexrecord component.intz()Returns the value of thezrecord component.
-
Field Details
-
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 aHorizontalBlockPosrecord class.- Parameters:
x- the value for thexrecord componentz- the value for thezrecord component
-
-
Method Details
-
of
-
is
public boolean is(net.minecraft.core.BlockPos pos) -
offset
-
offset
-
subtract
-
multiply
-
north
-
north
-
south
-
south
-
west
-
west
-
east
-
east
-
relative
-
relative
-
rotate
-
distanceToSqr
-
closest
-
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. All components in this record class are compared with '=='. -
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. -
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-