Package dev.latvian.mods.klib.math
Record Class Cursor
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.math.Cursor
public record Cursor(net.minecraft.world.phys.Vec3 pos, net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction direction)
extends Record
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.BlockPosblockPos()Returns the value of theblockPosrecord component.net.minecraft.core.DirectionReturns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.static @Nullable CursorfromNBT(@Nullable net.minecraft.nbt.Tag tag) 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.Vec3pos()Returns the value of theposrecord component.net.minecraft.nbt.CompoundTagtoNBT(net.minecraft.nbt.CompoundTag nbt) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Cursor
public Cursor(net.minecraft.world.phys.BlockHitResult hit) -
Cursor
public Cursor(net.minecraft.world.phys.Vec3 pos, net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction direction) Creates an instance of aCursorrecord class.- Parameters:
pos- the value for theposrecord componentblockPos- the value for theblockPosrecord componentdirection- the value for thedirectionrecord component
-
-
Method Details
-
fromNBT
-
getOffsetBlockPos
public net.minecraft.core.BlockPos getOffsetBlockPos() -
getBottomCenter
public net.minecraft.world.phys.Vec3 getBottomCenter() -
getCenter
public net.minecraft.world.phys.Vec3 getCenter() -
toNBT
public net.minecraft.nbt.CompoundTag toNBT(net.minecraft.nbt.CompoundTag nbt) -
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. -
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). -
pos
public net.minecraft.world.phys.Vec3 pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
blockPos
public net.minecraft.core.BlockPos blockPos()Returns the value of theblockPosrecord component.- Returns:
- the value of the
blockPosrecord component
-
direction
public net.minecraft.core.Direction direction()Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-