use of net.tslat.aoa3.entity.boss.shadowlord.EntityShadowlord in project Advent-Of-Ascension by Tslat.
the class ShadowlordSpawnTask method run.
@Override
public void run() {
if (spawned) {
for (int x = -2; x <= 2; x += 4) {
for (int z = -2; z <= 2; z += 4) {
BlockPos pos = altarPosition.add(x, 1, z);
Block block = player.world.getBlockState(pos).getBlock();
if (block instanceof LampBlock)
player.world.setBlockState(pos, ((LampBlock) block).getOnLamp().getDefaultState().withProperty(LampBlock.FIXED_LAMP, true));
}
}
} else if (spawning) {
spawned = true;
EntityShadowlord shadowlord = new EntityShadowlord(player.world);
shadowlord.setLocationAndAngles(altarPosition.getX(), altarPosition.getY() + 3, altarPosition.getZ(), 0, 0);
player.world.spawnEntity(shadowlord);
StringUtil.sendMessageWithinRadius(StringUtil.getLocaleWithArguments("message.mob.shadowlord.spawn", player.getDisplayNameString()), player, 50);
schedule(5, TimeUnit.SECONDS);
} else {
for (int x = -2; x <= 2; x++) {
for (int y = 0; y <= 1; y++) {
for (int z = -2; z <= 2; z++) {
BlockPos pos = altarPosition.add(x, y, z);
IBlockState state = player.world.getBlockState(pos);
Block block = state.getBlock();
if (block instanceof LampBlock && block != ((LampBlock) block).getOffLamp()) {
player.world.setBlockState(pos, ((LampBlock) block).getOffLamp().getDefaultState(), 2);
schedule(2, TimeUnit.SECONDS);
player.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, pos.getX(), pos.getY(), pos.getZ(), 0, 0, 0);
return;
}
}
}
}
spawning = true;
schedule(1, TimeUnit.SECONDS);
}
}
Aggregations