class AIRaidFarm extends EntityAIMoveToBlock
{
private boolean field_179498_d;
private boolean field_179499_e = false;
private static final String __OBFID = "CL_00002233";
public AIRaidFarm()
{
super(EntityRabbit.this, 0.699999988079071D, 16);
}
public boolean shouldExecute()
{
if (this.field_179496_a <= 0)
{
if (!EntityRabbit.this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"))
{
return false;
}
this.field_179499_e = false;
this.field_179498_d = EntityRabbit.this.func_175534_cv();
}
return super.shouldExecute();
}
public boolean continueExecuting()
{
return this.field_179499_e && super.continueExecuting();
}
public void startExecuting()
{
super.startExecuting();
}
public void resetTask()
{
super.resetTask();
}
public void updateTask()
{
super.updateTask();
EntityRabbit.this.getLookHelper().setLookPosition((double)this.field_179494_b.getX() + 0.5D, (double)(this.field_179494_b.getY() + 1), (double)this.field_179494_b.getZ() + 0.5D, 10.0F, (float)EntityRabbit.this.getVerticalFaceSpeed());
if (this.func_179487_f())
{
World var1 = EntityRabbit.this.worldObj;
BlockPos var2 = this.field_179494_b.offsetUp();
IBlockState var3 = var1.getBlockState(var2);
Block var4 = var3.getBlock();
if (this.field_179499_e && var4 instanceof BlockCarrot && ((Integer)var3.getValue(BlockCarrot.AGE)).intValue() == 7)
{
var1.setBlockState(var2, Blocks.air.getDefaultState(), 2);
var1.destroyBlock(var2, true);
EntityRabbit.this.func_175528_cn();
}
this.field_179499_e = false;
this.field_179496_a = 10;
}
}
protected boolean func_179488_a(World worldIn, BlockPos p_179488_2_)
{
Block var3 = worldIn.getBlockState(p_179488_2_).getBlock();
if (var3 == Blocks.farmland)
{
p_179488_2_ = p_179488_2_.offsetUp();
IBlockState var4 = worldIn.getBlockState(p_179488_2_);
var3 = var4.getBlock();
if (var3 instanceof BlockCarrot && ((Integer)var4.getValue(BlockCarrot.AGE)).intValue() == 7 && this.field_179498_d && !this.field_179499_e)
{
this.field_179499_e = true;
return true;
}
}
return false;
}
}