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));
}
}
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));
}
}
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));
}
}
Aggregations