Package io.papermc.paper.math
Interface BlockPosition
- All Superinterfaces:
Position
A position represented with integers.
May see breaking changes until Experimental annotation is removed.
- See Also:
-
Field Summary
Fields inherited from interface io.papermc.paper.math.Position
BLOCK_ZERO, FINE_ZERO
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
isBlock()
Checks of this position represents aBlockPosition
default boolean
isFine()
Checks if this position represents aFinePosition
default @NotNull FinePosition
offset
(double x, double y, double z) Returns a position offset by the specified amounts.default @NotNull BlockPosition
offset
(int x, int y, int z) Returns a position offset by the specified amounts.default @NotNull BlockPosition
Returns a block position offset by the amount along the specified axis.default @NotNull BlockPosition
Returns a block position offset by 1 in the direction specified.default @NotNull BlockPosition
Returns a block position offset in the direction specified multiplied by the amount.default @NotNull BlockPosition
toBlock()
Returns the block position of this position or itself if it already is a block positiondefault double
x()
Gets the x value for this positiondefault double
y()
Gets the y value for this positiondefault double
z()
Gets the z value for this position
-
Method Details
-
x
default double x()Description copied from interface:Position
Gets the x value for this position -
y
default double y()Description copied from interface:Position
Gets the y value for this position -
z
default double z()Description copied from interface:Position
Gets the z value for this position -
isBlock
default boolean isBlock()Description copied from interface:Position
Checks of this position represents aBlockPosition
-
isFine
default boolean isFine()Description copied from interface:Position
Checks if this position represents aFinePosition
-
toBlock
Description copied from interface:Position
Returns the block position of this position or itself if it already is a block position -
offset
Description copied from interface:Position
Returns a position offset by the specified amounts. -
offset
Description copied from interface:Position
Returns a position offset by the specified amounts. -
offset
@Contract(value="_ -> new", pure=true) @NotNull default @NotNull BlockPosition offset(@NotNull @NotNull BlockFace blockFace) Returns a block position offset by 1 in the direction specified.- Parameters:
blockFace
- the block face to offset towards- Returns:
- the offset block position
-
offset
@Contract(pure=true) @NotNull default @NotNull BlockPosition offset(@NotNull @NotNull BlockFace blockFace, int amount) Returns a block position offset in the direction specified multiplied by the amount.- Parameters:
blockFace
- the block face to offset towardsamount
- the number of times to move in that direction- Returns:
- the offset block position
-
offset
@Contract(pure=true) @NotNull default @NotNull BlockPosition offset(@NotNull @NotNull Axis axis, int amount) Returns a block position offset by the amount along the specified axis.- Parameters:
axis
- the axis to offset alongamount
- the amount to offset along that axis- Returns:
- the offset block position
-