@EventHandler
public void onPlayerInteract2(PlayerInteractEvent e) {
Player player = e.getPlayer();
PlayerInventory inventory = player.getInventory();
if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
Material material = inventory.getItemInHand().getType();
if(material == Material.BOW) {
DynamicAC.getManager().getBackend().logBowWindUp(player, System.currentTimeMillis());
} else if(Utilities.isFood(material)) {
DynamicAC.getManager().getBackend().logEatingStart(player);
}
}
Block block = e.getClickedBlock();
if(block != null) {
Distance distance = new Distance(player.getLocation(), block.getLocation());
DynamicAC.getManager().getBackend().checkLongReachBlock(player,distance.getXDifference(),distance
.getYDifference(),distance.getZDifference());
}
}
PlayerListener.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:DynamicAC
作者:
评论列表
文章目录