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 SummaryFields inherited from interface io.papermc.paper.math.PositionBLOCK_ZERO, FINE_ZERO
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleanisBlock()Checks of this position represents aBlockPositiondefault booleanisFine()Checks if this position represents aFinePositiondefault @NotNull FinePositionoffset(double x, double y, double z) Returns a position offset by the specified amounts.default @NotNull BlockPositionoffset(int x, int y, int z) Returns a position offset by the specified amounts.default @NotNull BlockPositionReturns a block position offset by the amount along the specified axis.default @NotNull BlockPositionReturns a block position offset by 1 in the direction specified.default @NotNull BlockPositionReturns a block position offset in the direction specified multiplied by the amount.default @NotNull BlockPositiontoBlock()Returns the block position of this position or itself if it already is a block positiondefault doublex()Gets the x value for this positiondefault doubley()Gets the y value for this positiondefault doublez()Gets the z value for this position
- 
Method Details- 
xdefault double x()Description copied from interface:PositionGets the x value for this position
- 
ydefault double y()Description copied from interface:PositionGets the y value for this position
- 
zdefault double z()Description copied from interface:PositionGets the z value for this position
- 
isBlockdefault boolean isBlock()Description copied from interface:PositionChecks of this position represents aBlockPosition
- 
isFinedefault boolean isFine()Description copied from interface:PositionChecks if this position represents aFinePosition
- 
toBlockDescription copied from interface:PositionReturns the block position of this position or itself if it already is a block position
- 
offsetDescription copied from interface:PositionReturns a position offset by the specified amounts.
- 
offsetDescription copied from interface:PositionReturns 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 towards
- amount- 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 along
- amount- the amount to offset along that axis
- Returns:
- the offset block position
 
 
-