@Override
public boolean continueExecuting()
{
if(destination == null){ // suitable destination not yet established
// Utility.chatMessage("looking for a spot to plant sapling");
Point candidate = new Point();
int blockID = 0;
for(int i = 0; i < 10; ++i){
// choose a spot 5-10m away from citizen in a random direction
candidate.polarTranslation(Utility.rng.nextRadian(), Math.PI/2, 5 + Utility.rng.nextInt(5));
candidate.plus(citizen.posX, citizen.posY, citizen.posZ);
// move destination away from logging camp if necessary
if(candidate.getDistance(citizen.homeTown.xCoord, citizen.homeTown.yCoord, citizen.homeTown.zCoord) < 10){
double theta = Math.atan2(candidate.y - citizen.homeTown.yCoord, candidate.x - citizen.homeTown.xCoord);
candidate.polarTranslation(theta, Math.PI/2, 10);
}
Utility.terrainAdjustment(citizen.worldObj, candidate);
// if we found dirt that can see sky, we're good; set navigator and return true
if(citizen.worldObj.canBlockSeeTheSky((int)candidate.x, (int)candidate.y, (int)candidate.z)){