当前位置: 首页>>代码示例>>Java>>正文


Java BlockFace.NORTH_EAST属性代码示例

本文整理汇总了Java中org.bukkit.block.BlockFace.NORTH_EAST属性的典型用法代码示例。如果您正苦于以下问题:Java BlockFace.NORTH_EAST属性的具体用法?Java BlockFace.NORTH_EAST怎么用?Java BlockFace.NORTH_EAST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.block.BlockFace的用法示例。


在下文中一共展示了BlockFace.NORTH_EAST属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBlockFace

static BlockFace getBlockFace(byte rotation) {
    switch (rotation) {
        case 0:
            return BlockFace.NORTH;
        case 1:
            return BlockFace.NORTH_NORTH_EAST;
        case 2:
            return BlockFace.NORTH_EAST;
        case 3:
            return BlockFace.EAST_NORTH_EAST;
        case 4:
            return BlockFace.EAST;
        case 5:
            return BlockFace.EAST_SOUTH_EAST;
        case 6:
            return BlockFace.SOUTH_EAST;
        case 7:
            return BlockFace.SOUTH_SOUTH_EAST;
        case 8:
            return BlockFace.SOUTH;
        case 9:
            return BlockFace.SOUTH_SOUTH_WEST;
        case 10:
            return BlockFace.SOUTH_WEST;
        case 11:
            return BlockFace.WEST_SOUTH_WEST;
        case 12:
            return BlockFace.WEST;
        case 13:
            return BlockFace.WEST_NORTH_WEST;
        case 14:
            return BlockFace.NORTH_WEST;
        case 15:
            return BlockFace.NORTH_NORTH_WEST;
        default:
            throw new AssertionError(rotation);
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:38,代码来源:CraftSkull.java

示例2: getBlockFace

public static BlockFace getBlockFace(double yaw){
	int y = (int) ((yaw+11.25)/22.5);
	switch(y){
	case -8:
		return BlockFace.NORTH;
	case -7:
		return BlockFace.NORTH_NORTH_EAST;
	case -6:
		return BlockFace.NORTH_EAST;
	case -5:
		return BlockFace.EAST_NORTH_EAST;
	case -4:
		return BlockFace.EAST;
	case -3:
		return BlockFace.EAST_SOUTH_EAST;
	case -2:
		return BlockFace.SOUTH_EAST;
	case -1:
		return BlockFace.SOUTH_SOUTH_EAST;
	case 0:
		return BlockFace.SOUTH;
	case 1:
		return BlockFace.SOUTH_SOUTH_WEST;
	case 2:
		return BlockFace.SOUTH_WEST;
	case 3:
		return BlockFace.WEST_SOUTH_WEST;
	case 4:
		return BlockFace.WEST;
	case 5:
		return BlockFace.WEST_NORTH_WEST;
	case 6:
		return BlockFace.NORTH_WEST;
	case 7:
		return BlockFace.NORTH_NORTH_WEST;
	default:
		return BlockFace.NORTH;
	}
}
 
开发者ID:dracnis,项目名称:VanillaPlus,代码行数:39,代码来源:BlockFaceUtil.java


注:本文中的org.bukkit.block.BlockFace.NORTH_EAST属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。