Package net.frozenblock.lib.gametest.api
Record Class TrackedPosition<T>
java.lang.Object
java.lang.Record
net.frozenblock.lib.gametest.api.TrackedPosition<T>
- Type Parameters:
T- The type of position being tracked- Record Components:
type- ThePositionTypelinked topos.pos- The positionopposite- The position in the opposite position type
- Since:
- 1.3.8
-
Constructor Summary
ConstructorsConstructorDescriptionTrackedPosition(PositionType type, T pos, T opposite) Creates an instance of aTrackedPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionabsolute()assertBlockPresent(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block) static TrackedPosition<net.minecraft.core.BlockPos> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its absolute value.static TrackedPosition<net.minecraft.core.BlockPos> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its absolute value.static TrackedPosition<net.minecraft.world.phys.Vec3> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its absolute value.static TrackedPosition<net.minecraft.world.phys.Vec3> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its absolute value.static TrackedPosition<net.minecraft.core.BlockPos> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its relative value.static TrackedPosition<net.minecraft.core.BlockPos> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its relative value.static TrackedPosition<net.minecraft.world.phys.Vec3> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its relative value.static TrackedPosition<net.minecraft.world.phys.Vec3> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its relative value.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.opposite()Returns the value of theoppositerecord component.pos()Returns the value of theposrecord component.relative()final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Method Details
-
createRelative
public static TrackedPosition<net.minecraft.core.BlockPos> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its relative value. -
createRelative
public static TrackedPosition<net.minecraft.core.BlockPos> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its relative value.Asserts the given block is at the position.
-
createAbsolute
public static TrackedPosition<net.minecraft.core.BlockPos> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its absolute value. -
createAbsolute
public static TrackedPosition<net.minecraft.core.BlockPos> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.core.BlockPos pos) Creates a newTrackedPositionwith the given position as its absolute value.Asserts the given block is at the relative position.
-
createRelative
public static TrackedPosition<net.minecraft.world.phys.Vec3> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its relative value. -
createRelative
public static TrackedPosition<net.minecraft.world.phys.Vec3> createRelative(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its relative value.Asserts the given block is at the position.
-
createAbsolute
public static TrackedPosition<net.minecraft.world.phys.Vec3> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its absolute value. -
createAbsolute
public static TrackedPosition<net.minecraft.world.phys.Vec3> createAbsolute(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block, net.minecraft.world.phys.Vec3 pos) Creates a newTrackedPositionwith the given position as its absolute value.Asserts the given block is at the relative position.
-
absolute
-
relative
-
assertBlockPresent
public TrackedPosition<T> assertBlockPresent(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.level.block.Block block) throws IllegalStateException - Throws:
IllegalStateException
-
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
opposite
Returns the value of theoppositerecord component.- Returns:
- the value of the
oppositerecord component
-