Search in sources :

Example 1 with EvokerFangsEntity

use of net.minecraft.entity.mob.EvokerFangsEntity in project Biome-Makeover by Lemonszz.

the class AdjudicatorFangGoal method conjureFangs.

private void conjureFangs(double x, double z, double maxY, double y, float yaw, int warmup) {
    BlockPos blockPos = new BlockPos(x, y, z);
    boolean bl = false;
    double d = 0.0D;
    do {
        BlockPos blockPos2 = blockPos.down();
        BlockState blockState = adjudicator.world.getBlockState(blockPos2);
        if (blockState.isSideSolidFullSquare(adjudicator.world, blockPos2, Direction.UP)) {
            if (!adjudicator.world.isAir(blockPos)) {
                BlockState blockState2 = adjudicator.world.getBlockState(blockPos);
                VoxelShape voxelShape = blockState2.getCollisionShape(adjudicator.world, blockPos);
                if (!voxelShape.isEmpty()) {
                    d = voxelShape.getMax(Direction.Axis.Y);
                }
            }
            bl = true;
            break;
        }
        blockPos = blockPos.down();
    } while (blockPos.getY() >= MathHelper.floor(maxY) - 1);
    if (bl) {
        adjudicator.world.spawnEntity(new EvokerFangsEntity(adjudicator.world, x, (double) blockPos.getY() + d, z, yaw, warmup, adjudicator));
    }
}
Also used : BlockState(net.minecraft.block.BlockState) VoxelShape(net.minecraft.util.shape.VoxelShape) BlockPos(net.minecraft.util.math.BlockPos) EvokerFangsEntity(net.minecraft.entity.mob.EvokerFangsEntity)

Example 2 with EvokerFangsEntity

use of net.minecraft.entity.mob.EvokerFangsEntity in project Biome-Makeover by Lemonszz.

the class FangBarragePhase method conjureFangs.

private void conjureFangs(double x, double z, double maxY, double y, float yaw, int warmup) {
    BlockPos blockPos = new BlockPos(x, y, z);
    boolean bl = false;
    double d = 0.0D;
    do {
        BlockPos blockPos2 = blockPos.down();
        BlockState blockState = adjudicator.world.getBlockState(blockPos2);
        if (blockState.isSideSolidFullSquare(adjudicator.world, blockPos2, Direction.UP)) {
            if (!adjudicator.world.isAir(blockPos)) {
                BlockState blockState2 = adjudicator.world.getBlockState(blockPos);
                VoxelShape voxelShape = blockState2.getCollisionShape(adjudicator.world, blockPos);
                if (!voxelShape.isEmpty()) {
                    d = voxelShape.getMax(Direction.Axis.Y);
                }
            }
            bl = true;
            break;
        }
        blockPos = blockPos.down();
    } while (blockPos.getY() >= MathHelper.floor(maxY) - 1);
    if (bl) {
        adjudicator.world.spawnEntity(new EvokerFangsEntity(adjudicator.world, x, (double) blockPos.getY() + d, z, yaw, warmup, adjudicator));
    }
}
Also used : BlockState(net.minecraft.block.BlockState) VoxelShape(net.minecraft.util.shape.VoxelShape) BlockPos(net.minecraft.util.math.BlockPos) EvokerFangsEntity(net.minecraft.entity.mob.EvokerFangsEntity)

Example 3 with EvokerFangsEntity

use of net.minecraft.entity.mob.EvokerFangsEntity in project Neutrino by FrostWizard4.

the class SummonEvokerFangs method conjureFangs.

private static void conjureFangs(Entity entity, double x, double z, double maxY, double y, float yaw, int warmup) {
    BlockPos blockPos = new BlockPos(x, y, z);
    boolean bl = false;
    double d = 0.0D;
    do {
        BlockPos blockPos2 = blockPos.down();
        BlockState blockState = entity.world.getBlockState(blockPos2);
        if (blockState.isSideSolidFullSquare(entity.world, blockPos2, Direction.UP)) {
            if (!entity.world.isAir(blockPos)) {
                BlockState blockState2 = entity.world.getBlockState(blockPos);
                VoxelShape voxelShape = blockState2.getCollisionShape(entity.world, blockPos);
                if (!voxelShape.isEmpty()) {
                    d = voxelShape.getMax(Direction.Axis.Y);
                }
            }
            bl = true;
            break;
        }
        blockPos = blockPos.down();
    } while (blockPos.getY() >= MathHelper.floor(maxY) - 1);
    if (bl) {
        entity.world.spawnEntity(new EvokerFangsEntity(entity.world, x, (double) blockPos.getY() + d, z, yaw, warmup, (LivingEntity) entity));
    }
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) BlockState(net.minecraft.block.BlockState) VoxelShape(net.minecraft.util.shape.VoxelShape) BlockPos(net.minecraft.util.math.BlockPos) EvokerFangsEntity(net.minecraft.entity.mob.EvokerFangsEntity)

Aggregations

BlockState (net.minecraft.block.BlockState)3 EvokerFangsEntity (net.minecraft.entity.mob.EvokerFangsEntity)3 BlockPos (net.minecraft.util.math.BlockPos)3 VoxelShape (net.minecraft.util.shape.VoxelShape)3 LivingEntity (net.minecraft.entity.LivingEntity)1