/** Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { if (!this.theEntity.isCollidedHorizontally) { return false; } else { PathNavigateGround var1 = (PathNavigateGround) this.theEntity.getNavigator(); PathEntity var2 = var1.getPath(); if (var2 != null && !var2.isFinished() && var1.func_179686_g()) { for (int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3) { PathPoint var4 = var2.getPathPointFromIndex(var3); this.field_179507_b = new BlockPos(var4.xCoord, var4.yCoord + 1, var4.zCoord); if (this.theEntity.getDistanceSq( (double) this.field_179507_b.getX(), this.theEntity.posY, (double) this.field_179507_b.getZ()) <= 2.25D) { this.doorBlock = this.func_179506_a(this.field_179507_b); if (this.doorBlock != null) { return true; } } } this.field_179507_b = (new BlockPos(this.theEntity)).offsetUp(); this.doorBlock = this.func_179506_a(this.field_179507_b); return this.doorBlock != null; } else { return false; } } }