net.minecraft.util.Direction#SOUTH源码实例Demo

下面列出了net.minecraft.util.Direction#SOUTH 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: CodeChickenLib   文件: RotationUtils.java
/**
 * Rotate this Facing around all axises counter-clockwise (NORTH => SOUTH => EAST => WEST => UP => DOWN => NORTH)
 *
 * @param facing Current facing.
 * @return Next facing.
 */
public static Direction rotateForward(Direction facing) {
    switch (facing) {
        case NORTH:
            return Direction.DOWN;
        case DOWN:
            return Direction.UP;
        case UP:
            return Direction.WEST;
        case WEST:
            return Direction.EAST;
        case EAST:
            return Direction.SOUTH;
        case SOUTH:
            return Direction.NORTH;
    }
    return Direction.NORTH;
}
 
源代码2 项目: CodeChickenLib   文件: RotationUtils.java
/**
 * Rotate this Facing around all axises counter-clockwise (NORTH => DOWN => UP => WEST => EAST => SOUTH => NORTH)
 *
 * @param facing Current facing.
 * @return Next facing.
 */
public static Direction rotateBackwards(Direction facing) {
    switch (facing) {
        case NORTH:
            return Direction.SOUTH;
        case SOUTH:
            return Direction.EAST;
        case EAST:
            return Direction.WEST;
        case WEST:
            return Direction.UP;
        case UP:
            return Direction.DOWN;
        case DOWN:
            return Direction.NORTH;
    }
    return Direction.NORTH;
}
 
源代码3 项目: CodeChickenLib   文件: VectorUtils.java
/**
 * Calculates the EnumFacing for a given normal.
 *
 * @param normal The normal to calculate from.
 * @return The direction the normal is facing.
 */
public static Direction calcNormalSide(Vector3 normal) {
    if (normal.y <= -0.99) {
        return Direction.DOWN;
    }
    if (normal.y >= 0.99) {
        return Direction.UP;
    }
    if (normal.z <= -0.99) {
        return Direction.NORTH;
    }
    if (normal.z >= 0.99) {
        return Direction.SOUTH;
    }
    if (normal.x <= -0.99) {
        return Direction.WEST;
    }
    if (normal.x >= 0.99) {
        return Direction.EAST;
    }
    return null;
}
 
源代码4 项目: CodeChickenLib   文件: CustomParticleHandler.java
@OnlyIn (Dist.CLIENT)
public static void addBlockHitEffects(World world, Cuboid6 bounds, Direction side, TextureAtlasSprite icon, ParticleManager particleManager) {
    float border = 0.1F;
    Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2 * border);
    diff.x *= world.rand.nextDouble();
    diff.y *= world.rand.nextDouble();
    diff.z *= world.rand.nextDouble();
    Vector3 pos = diff.add(bounds.min).add(border);

    if (side == Direction.DOWN) {
        diff.y = bounds.min.y - border;
    }
    if (side == Direction.UP) {
        diff.y = bounds.max.y + border;
    }
    if (side == Direction.NORTH) {
        diff.z = bounds.min.z - border;
    }
    if (side == Direction.SOUTH) {
        diff.z = bounds.max.z + border;
    }
    if (side == Direction.WEST) {
        diff.x = bounds.min.x - border;
    }
    if (side == Direction.EAST) {
        diff.x = bounds.max.x + border;
    }

    particleManager.addEffect(new CustomBreakingParticle(world, pos.x, pos.y, pos.z, 0, 0, 0, icon).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
 
源代码5 项目: CodeChickenLib   文件: RotationUtils.java
/**
 * Rotate this Facing around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH)
 *
 * @param facing Current facing.
 * @return Next facing.
 */
public static Direction rotateCounterClockwise(Direction facing) {
    switch (facing) {
        case NORTH:
            return Direction.WEST;
        case EAST:
            return Direction.NORTH;
        case SOUTH:
            return Direction.EAST;
        case WEST:
            return Direction.SOUTH;
        default:
            throw new IllegalStateException("Unable to get CCW facing of " + facing);
    }
}
 
源代码6 项目: CodeChickenLib   文件: RotationUtils.java
/**
 * Rotate this Facing around the Y axis counter-clockwise (NORTH => EAST => SOUTH => WEST => NORTH)
 *
 * @param facing Current facing.
 * @return Next facing.
 */
public static Direction rotateClockwise(Direction facing) {
    switch (facing) {
        case NORTH:
            return Direction.EAST;
        case EAST:
            return Direction.SOUTH;
        case SOUTH:
            return Direction.WEST;
        case WEST:
            return Direction.NORTH;
        default:
            throw new IllegalStateException("Unable to get CW facing of " + facing);
    }
}
 
源代码7 项目: CodeChickenLib   文件: RotationUtils.java
/**
 * Turns Entity rotation in to Direction.
 *
 * @param rotation The entity rotation, Generally MathHelper.floor_double((entity.rotationYaw * 4F) / 360F + 0.5D) & 3;
 * @return The rotation in Direction.
 */
public static Direction entityRotationToSide(int rotation) {
    switch (rotation) {
        case 0:
            return Direction.SOUTH;
        case 1:
            return Direction.WEST;
        case 2:
            return Direction.NORTH;
        default:
            return Direction.EAST;
    }
}