Class BlockUtil
java.lang.Object
cn.lanink.gamecore.pathfinder.utils.BlockUtil
- Author:
- iGxnon
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanStand(cn.nukkit.block.Block block) static booleancheckUpAccessed(cn.nukkit.block.Block block) static cn.nukkit.block.BlockgetNearBlock(cn.nukkit.block.Block block, cn.nukkit.math.BlockFace face) static booleanisPermeable(cn.nukkit.block.Block block) static doubleMHDistance(cn.nukkit.math.Vector3 start, cn.nukkit.math.Vector3 target) 获取曼哈顿距离
-
Field Details
-
MOTION
public static final int[][] MOTION除自身外26个方向
-
-
Constructor Details
-
BlockUtil
public BlockUtil()
-
-
Method Details
-
MHDistance
public static double MHDistance(cn.nukkit.math.Vector3 start, cn.nukkit.math.Vector3 target) 获取曼哈顿距离- Parameters:
start- 当前点target- 终点- Returns:
- 曼哈顿距离
-
isPermeable
public static boolean isPermeable(cn.nukkit.block.Block block) - Parameters:
block- 方块- Returns:
- 是否可透过
-
canStand
public static boolean canStand(cn.nukkit.block.Block block) - Parameters:
block- 检测对象- Returns:
- 是否可以立足
-
checkUpAccessed
public static boolean checkUpAccessed(cn.nukkit.block.Block block) - Parameters:
block- 检测对象- Returns:
- 是否可以垂直上升一格 [爬梯子,脚手架]
-
getNearBlock
public static cn.nukkit.block.Block getNearBlock(cn.nukkit.block.Block block, cn.nukkit.math.BlockFace face) - Parameters:
block- 检测对象face- 方块相对世界坐标的面- Returns:
- 邻居方块
-