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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ClipPosition> static final DataType<ClipPosition> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, ClipPosition> -
Constructor Summary
ConstructorsConstructorDescriptionClipPosition(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 aClipPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.BlockPosReturns the value of theblockPositionrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.phys.Vec3net.minecraft.world.phys.Vec3net.minecraft.core.BlockPosfinal inthashCode()Returns a hash code value for this object.net.minecraft.world.phys.Vec3position()Returns the value of thepositionrecord component.net.minecraft.core.Directionside()Returns the value of thesiderecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, ClipPosition> STREAM_CODEC -
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 aClipPositionrecord class.- Parameters:
position- the value for thepositionrecord componentblockPosition- the value for theblockPositionrecord componentside- the value for thesiderecord 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
-
hashCode
-
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 withObjects::equals(Object,Object). -
position
public net.minecraft.world.phys.Vec3 position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
blockPosition
public net.minecraft.core.BlockPos blockPosition()Returns the value of theblockPositionrecord component.- Returns:
- the value of the
blockPositionrecord component
-
side
public net.minecraft.core.Direction side()Returns the value of thesiderecord component.- Returns:
- the value of the
siderecord component
-